From patchwork Thu Apr 5 08:35:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 132845 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp6018661ljb; Thu, 5 Apr 2018 01:38:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+6doYY/9oyiHp9cF2mbaFuZT4TOnlgjMzHHlo5cBqaXem5rVRlQpYwbO1zOhZsQXOzAjeU X-Received: by 10.28.106.17 with SMTP id f17mr10700804wmc.92.1522917534991; Thu, 05 Apr 2018 01:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522917534; cv=none; d=google.com; s=arc-20160816; b=qg0ar1hdwoZ/fYzkNKj0lqpQH4OTazuOIcful8tvSYkkoDfRqG3/t+Sw5/DBxnpxEw 3JWEGIbqrMksuB8/IE5KlckFZ3ZDeJdtbq57ifJdZknuk8UBFrm37xyNh1TAUyZZtcTo fkQSEKJVvIJ7AaSzq2UnqJNupJis1M3OaXCzfmfpyvVrFeA9kgVtmgV6thIZNXyyWo9J jBLlXJi7DOE6J6zVTSK4ZZHM1OCuJqmFFARp6j+VTMCZWVYo1qehc7nSn3cVV9h7KSDh ZYMmZFBBiPkbyOyOQIT6FoxYVwD93osGOeCPxAbhuMKjgazE4NPOtOWOA0j3O4uZSZ67 lnCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:cc:to:from :dkim-signature:arc-authentication-results; bh=gxmK053qoTKqk7LqTBD4N+ta4MzP22FlzHz0ydnSBCk=; b=eQEQo7z3+OxE2Gi1dyDRjYznGgm+dwV+C5PSkuqSKmRqeo+lXz8GgZX4NaO3hFHaRJ htwT1heeo9L9nb66V+MHYCb+ma4lk4wXWRNmxFRTLyXNgfXjImN/t2AAxfI9tfCj0Mdb jBBkf4pg+Xppdg430D5B2WNkYkOlNjXyysTZuSG4EbMLH3I1AO1CRpRyj7LcoL6RC46Y bubcreTjPXdV8mAz6ILrr9DdJB4zLJa0lvSYaoaCfFQAsrZ319he+CR6xrndfPhMOWz4 SrUCc4+4RagAVAQVqO4Gjpazmxd3Pxk7VY5ic/NNOMiWHuM1D+28PNfjZtW+mvNdFtAZ L7DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=IZslYUkS; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id w6si5362973wrc.153.2018.04.05.01.38.54; Thu, 05 Apr 2018 01:38:54 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=IZslYUkS; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B70EE1C9D9; Thu, 5 Apr 2018 10:38:53 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20089.outbound.protection.outlook.com [40.107.2.89]) by dpdk.org (Postfix) with ESMTP id DF9AC1C9D4 for ; Thu, 5 Apr 2018 10:38:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gxmK053qoTKqk7LqTBD4N+ta4MzP22FlzHz0ydnSBCk=; b=IZslYUkSKSjUXRDY5zOr0wTTJ9WpKeb+EN/4YnE4yFrDSQJ/bp+dBajNPOJcEW0QaTUE8EZ6VLuAtYx+nvP4lc5w9kcmDvmo+AbDIoZiBw/UWBr0Bclu08NLVd6ht1AAzfK5AwaRy7QoPN+WVsJkm7s+BE+ETi+lneyNCfP/AAw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by AM2PR04MB0754.eurprd04.prod.outlook.com (2a01:111:e400:8411::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.10; Thu, 5 Apr 2018 08:38:47 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, akhil.goyal@nxp.com, dpdk-up@NXP1.onmicrosoft.com Date: Thu, 5 Apr 2018 14:05:48 +0530 Message-Id: <1522917349-19049-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0031.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::17) To AM2PR04MB0754.eurprd04.prod.outlook.com (2a01:111:e400:8411::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 03f76199-f515-4f01-1c0c-08d59ad0a689 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM2PR04MB0754; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0754; 3:SnpUOGFIURYdAiYUOs6+nrS5TDjKhe4tuOoI/JleJGtCfVsLPZSIqCDG7Ju6DhrRtyuA2ZfTbrUHUyveGRxdswmp+HrhgyywZzLk+xCJMhqA87LKzKG4eZY+qrsOHUuMxkKBW1WsZNljMkIfoEcNIdpdn9nrFEI7PaCx0BduIp00AioLaDspJROVcfthmo65j2OR8sG+Ihi4MF8vwi7ZUW2YJa3blbP3VWxptxOzth/oSG84AfrlCqQr/SADL//z; 25:QycuZRxQogn9lM/XBC45w3NQjhUbDwl+pYxVeyqAxAoBtNBcqlxyE+LqGMyk7mbcD0u26I085qJXpIdizsvd3jJrSsAMZgXTQzPjZg8camsSvBnfywBa6AO/fC6tRAR3ov4qOe25aZTOk0GVofQYobA8gdNolX1/mGTDcsOWCKEOwqsYHxwlvFObCLsBmmHO/cMZMGvYFpMZP8L/8jRsUziH8TVu2tGx+NwpI+8vwJDINDtTHdEOFmVsUmkqnIyCOMLnkeXm06WSZjptnjH0fr1DLRHwvDAGIcJOf3OML1GUyEb8uYlgVw2vlOvtv3TesX3O95fKKE9RDdbBTFIOYg==; 31:gZhozOiNPRi9kcC8yDGm2qer84e46ZqkdeiCFh6FNmWUujealEEF9/0vn7kN64N65VpyggqJZO/tYVLcKssoL576gPI7AHQCZ7vFTvwPr+D8zvRdArgkHzVu/QQLuHA2bKqpnfOb4pEm4Kbpk1PhABYqcjc4MZNJS6trMJ5uqPPu102iOt3ZYX0Dx220Xme7UxJqGQOJadGVCa29RlwmEEFQHQb8rlFgibzqYJg6Gg0= X-MS-TrafficTypeDiagnostic: AM2PR04MB0754: X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0754; 20:0mjOK9agYf8JkkTAUpgcjjlPHMKQeP1dF/uZc863KH7cJudqD4cGeCkCCT00FmfS3kDb8xE9atZseaIK5mymqJIf/QgoejCRTY2oWQnbTDG0iauyAOTu2vfmBKFiDdYX1lDbkEXtcivsRveFFB31YrGSM8cffVqQAfG5/KtGfz4gx5G/UBT9yDYbOgdJCZ5FoRVckdcHXsQzekVjt7tXlrhA7c3PC9pGGuvNY8EnVg7vhljOxPBW48PU3cA/keN/y6kDxgSg+AAKbDJGyu+zfvQOuumIR2odh7ziHmVeRtEn4F+WLh6LtFcuIfL2GfryHMbTR5c4veyrhz8CXmp2Lp31U5F9pqmVN1Coe8PrRCpNduWHmDq9sV43u/Xn80H89UzMcuxdVfyYHaLTG/LxrO3mxqx1c9PGiF+eYpaDqaKONSKNE3DYUHXb4+HVLqZADwHSY/BH/4K74r3iujYDfBBBsadMJoBYNgTTZ7a4r7wOjEwrNRyjvSXf3sZlsMED; 4:LEwA2mgnPRTPOoLy+nRpuxh41Jqz3RZTbsZmUwUeBgCI4l70EdG+vVzKPpe65mH6qyJ4k7mqPpMEaUbQzgDWFduY91k7X/r7uroheiBa6C1HjZ8pm26jl38Mgh6U3Dmi+Bjxx6qQ1JX/lXIW/vtgZtAgBsGRXWig/JsjeDT5ARPLk9aH/Ds0aIaXNSJStY8nX48dZ/N/lCzSLLCGLKY3fzmBjTaDbYSI+n/bmuy2HGYWs8W/lOOB2zcNJXxrWy1X1dALfltRza9VDVWVT76+2rFPYsNQuDAAWpvgDWcWLpEMjBefmbSlVKfDkSl1rQKV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231221)(944501327)(52105095)(6055026)(6041310)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:AM2PR04MB0754; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0754; X-Forefront-PRVS: 06339BAE63 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(346002)(376002)(39860400002)(366004)(189003)(199004)(6486002)(107886003)(26005)(97736004)(2351001)(2616005)(53936002)(86362001)(4326008)(105586002)(956004)(25786009)(16526019)(486006)(305945005)(7736002)(5009440100003)(186003)(2906002)(2361001)(55236004)(52116002)(478600001)(51416003)(8676002)(50466002)(476003)(6916009)(5660300001)(81166006)(81156014)(386003)(68736007)(73566003)(6512007)(316002)(36756003)(50226002)(48376002)(6116002)(106356001)(8936002)(3846002)(59450400001)(47776003)(6506007)(16586007)(66066001)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR04MB0754; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR04MB0754; 23:AigzbmH1tK482FUdWswqeahX2GedrjbCmxMx4QhEN?= 2/mRzq93WgYJ43ElVzMp7Oaa4JP7jnWMePU/dnj/d0z3rCklB1ou/Bfr8GVWEL4svcQz/P0xqtPQrBvuNyMbsZ5ZoEB0a0d0efJbtGvC6zk8TgOVeYcpWSODmd6OzSiZY9azU3pVDXFGD9qwqNnBwTNkVZgd4AoP5ndOjp4z4IHMU7KcAyD1k9jSOqT/X8ChQ6vaD92L4AsL/R2CWKYb4HlMOISyggnGBe1/BR9g1IJbDQLgJgEu92jX3ZZWnBquDjc7TrR+2GqfsoUmzBVXkdIjAk42HZsdnnXVSMOYNjorekGBdGQKBEcXXwguc4FErBNviOkAZVWI5aXfvH//C5M2pMwp3IJkxZM3QIAFYqmY7HVp34CND7QqJGf0DyIRgUKPTDEQClpmYEmg5UD/g3EKDwvkSQMWEMObhU0RXvNZiq2pH2j4Q3erj0JRH/VDSszFI0iw5GNSrPA4PmezaMyqZGcjJtyLz/Lx/2Mki8tv04MbaNyo+eBp9VTZpLRtHX14mAIjMmLW8OOjJ3W1IMN7DrXwGqDirZkTvIVFQeuF9wcf8rbcdlV0FSR9FJDYObTOjAVbNWAGNncJfsfG3MCIBTBu0GodMBp+EDbDUZ2XfuraB6Pt2XX69d6X4PfsCb1fGP2dp4LcZPzUOEYcQQ1VR/e6lGODDrZFYpP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zGn1plBBYnL30leLqCHDJ9NZWtyM6CZCSQRsstCdSZ8HxzzBLYumETLrfK6h068CxbWQPXY6kc24F6IcbXW9h95xDg/LqQaZ7cRLTarnc5ppvedQ2pFMLe7HwiW4mMxLIIz8QChvbkx0IxGNbjxV0076ifitWCK0B1++22knY2P+2Jpzem2cj4jFEYDOauXya+Kx3jDNJQ7ITLH5eQlrPkNWw5QxO2jGz3cyw==; 5:lOORWwEd3sY/A+ooyHUnwYQOcmIih8vTD1Azjw2P1PdnUbDnGhYhd8wO5TkXfJxglxF3yG/gL9ub+PGXCIGsLzswbxXsG2wf5WtmmiHt6+HKuL3qM38z5eLen4GR7+bXywMEZLMLU7xGjNc4IbjSJposl+taTDvqiUP+XGU0Quc=; 24:xRqHSkmifAyIK3ylrdE5oQPKFtIKasoNFLtjlJmy1VhjDcHBEaP1IXfL40C/3ZKAIDbZLYI4kbBlu5K95jSU6QLbByY15Tlss0auKFlwwdE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0754; 7:ZWDrZR23DYZLMQ//PTBXFLvI5ABzpxMkWWSNT9NR4CeM62zQVnIvaeiyGXSL4oxST78ssdhTtXXqB2Vp52ywB+wHW0kLm7Q6tBqOdlI/atcHQxNC+xW8EgVh0PplcC+y1UgAqRMz7nwbr0CFAKCW3voRXrsdu1nypux5eqeoYs/Ey1w5jAy42Kqk8cr5j81tlC7PHKKIr5SQOf6hsnyaSkPivYWiP4jPMo3S3/LaJGmlTIORKsYe7AQzxlHPelXZ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2018 08:38:47.1609 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 03f76199-f515-4f01-1c0c-08d59ad0a689 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0754 Subject: [dpdk-dev] [PATCH 1/2] crypto/dpaa_sec: improve the error checking X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Sunil Kumar Kori Reported by NXP's internal coverity Signed-off-by: Sunil Kumar Kori --- drivers/crypto/dpaa_sec/dpaa_sec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.7.4 Acked-by: Akhil Goyal diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index c5191ce..79ccb22 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -388,7 +388,7 @@ static int dpaa_sec_prep_cdb(dpaa_sec_session *ses) { struct alginfo alginfo_c = {0}, alginfo_a = {0}, alginfo = {0}; - uint32_t shared_desc_len = 0; + int32_t shared_desc_len = 0; struct sec_cdb *cdb = &ses->cdb; int err; #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN @@ -530,6 +530,12 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) ses->digest_length, ses->dir); } } + + if (shared_desc_len < 0) { + PMD_TX_LOG(ERR, "error in preparing command block\n"); + return shared_desc_len; + } + cdb->sh_hdr.hi.field.idlen = shared_desc_len; cdb->sh_hdr.hi.word = rte_cpu_to_be_32(cdb->sh_hdr.hi.word); cdb->sh_hdr.lo.word = rte_cpu_to_be_32(cdb->sh_hdr.lo.word);