From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id C3642A0471 for ; Mon, 17 Jun 2019 13:10:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A419B1BEED; Mon, 17 Jun 2019 13:10:13 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id CB9AB1BEEC for ; Mon, 17 Jun 2019 13:10:11 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jun 2019 04:10:10 -0700 X-ExtLoop1: 1 Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by fmsmga007.fm.intel.com with ESMTP; 17 Jun 2019 04:10:09 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.143]) by IRSMSX106.ger.corp.intel.com ([169.254.8.222]) with mapi id 14.03.0439.000; Mon, 17 Jun 2019 12:10:09 +0100 From: "Kovacevic, Marko" To: "Zhang, Roy Fan" , "dev@dpdk.org" CC: "akhil.goyal@nxp.com" , "Zhang, Roy Fan" Thread-Topic: [dpdk-dev] [PATCH] examples/fips_validation: fix logically dead code Thread-Index: AQHVCzVRGwJNfJXiuEm4sh1UnsTBaKafx2iQ Date: Mon, 17 Jun 2019 11:10:08 +0000 Message-ID: <6DC05C7C5F25994B81B3F2F214251F66020F8308@IRSMSX104.ger.corp.intel.com> References: <20190515154121.75459-1-roy.fan.zhang@intel.com> In-Reply-To: <20190515154121.75459-1-roy.fan.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmI4ZjI3YzAtMDI1MS00MGZhLWIyMWUtZWU1ZDVhZTI2NDU5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSW9YRGxlaGlTbmQ2aHRMZjV4WEREYzZJZk5XTTFxaCtzTVFaTVwvcytcL1p6OWpLS2hXN3Q2bUxpTFhiRmpoRzRIIn0= x-ctpclassification: CTP_NT x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] examples/fips_validation: fix logically dead code 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" > Subject: [dpdk-dev] [PATCH] examples/fips_validation: fix logically dead > code >=20 > Coverity issue: 336866 > Coverity issue: 336841 > Coverity issue: 336838 > Fixes: 41d561cbdd24 ("examples/fips_validation: add power on self test") >=20 > Signed-off-by: Fan Zhang > --- > examples/fips_validation/fips_dev_self_test.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) >=20 > diff --git a/examples/fips_validation/fips_dev_self_test.c > b/examples/fips_validation/fips_dev_self_test.c > index df1c0e82e..444bbaa79 100644 > --- a/examples/fips_validation/fips_dev_self_test.c > +++ b/examples/fips_validation/fips_dev_self_test.c > @@ -1333,6 +1333,9 @@ check_cipher_result(struct rte_crypto_op *op, > uint32_t len, src_len; > int ret; >=20 > + if (!mbuf) > + return -1; > + > if (dir =3D=3D self_test_dir_enc_auth_gen) { > src =3D vec->output.data; > src_len =3D vec->output.len; > @@ -1342,7 +1345,7 @@ check_cipher_result(struct rte_crypto_op *op, > } >=20 > GET_MBUF_DATA(data, len, mbuf); > - if (!data && !len) > + if (!len) > return -1; >=20 > ret =3D memcmp(data, src, src_len); > @@ -1362,8 +1365,11 @@ check_auth_result(struct rte_crypto_op *op, > uint32_t len; > int ret; >=20 > + if (mbuf =3D=3D NULL) > + return -1; > + > GET_MBUF_DATA(data, len, mbuf); > - if (!data && !len) > + if (!len) > return -1; >=20 > if (dir =3D=3D self_test_dir_enc_auth_gen) { @@ -1387,6 +1393,9 @@ > check_aead_result(struct rte_crypto_op *op, > uint32_t len, src_len; > int ret; >=20 > + if (!mbuf) > + return -1; > + > if (op->sym->aead.aad.data) > rte_free(op->sym->aead.aad.data); >=20 > @@ -1399,7 +1408,7 @@ check_aead_result(struct rte_crypto_op *op, > } >=20 > GET_MBUF_DATA(data, len, mbuf); > - if (!data && !len) > + if (!len) > return -1; >=20 > ret =3D memcmp(data, src, src_len); > -- Acked-by: Marko Kovacevic