From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1B5EFA04B4 for ; Fri, 8 Nov 2019 15:50:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EFAA71C223; Fri, 8 Nov 2019 15:50:38 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id CC1371C12D; Fri, 8 Nov 2019 15:50:34 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Nov 2019 06:50:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,281,1569308400"; d="scan'208";a="286509714" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga001.jf.intel.com with ESMTP; 08 Nov 2019 06:50:33 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 8 Nov 2019 06:50:27 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 8 Nov 2019 06:50:26 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.127]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.63]) with mapi id 14.03.0439.000; Fri, 8 Nov 2019 22:50:24 +0800 From: "Xu, Rosen" To: Kevin Traynor , "dev@dpdk.org" CC: "david.marchand@redhat.com" , "stable@dpdk.org" Thread-Topic: [v2 PATCH 3/8] net/ipn3ke: fix incorrect commit check logic Thread-Index: AQHVlNTFw52slPqcR0CCc7SVgSVnzqeBXf6A Date: Fri, 8 Nov 2019 14:50:24 +0000 Message-ID: <0E78D399C70DA940A335608C6ED296D73AB3937E@SHSMSX104.ccr.corp.intel.com> References: <20191001125315.6191-1-ktraynor@redhat.com> <20191106190203.10750-1-ktraynor@redhat.com> <20191106190203.10750-4-ktraynor@redhat.com> In-Reply-To: <20191106190203.10750-4-ktraynor@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2MzMmZkYWEtZDk4NC00YTBlLTlkOWEtZDY0MjVhNTE1ZjZhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibmtQQkNMeFNZc2tyM0F3MzljaWViWVJmdnc1Y2JrdkhKREJ6VWRHVWJ3STZpNWFodUdFWWw4RUNsdzZsdlY4ViJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [v2 PATCH 3/8] net/ipn3ke: fix incorrect commit check logic X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, > -----Original Message----- > From: Kevin Traynor [mailto:ktraynor@redhat.com] > Sent: Thursday, November 07, 2019 3:02 > To: dev@dpdk.org > Cc: david.marchand@redhat.com; Kevin Traynor ; > Xu, Rosen ; stable@dpdk.org > Subject: [v2 PATCH 3/8] net/ipn3ke: fix incorrect commit check logic >=20 > Coverity is complaining about identical code regardless of which branch o= f > the if else is taken. Functionally it means an error will always be retur= ned if > this if else is hit. Remove the else branch. >=20 > CID 337928 (#1 of 1): Identical code for different branches > (IDENTICAL_BRANCHES)identical_branches: The same code is executed > regardless of whether n->level !=3D IPN3KE_TM_NODE_LEVEL_COS || > n->n_children !=3D 0U is true, because the 'then' and 'else' branches > are identical. Should one of the branches be modified, or the entire > 'if' statement replaced? > 1506 if (n->level !=3D IPN3KE_TM_NODE_LEVEL_COS || > 1507 n->n_children !=3D 0) { > 1508 return -rte_tm_error_set(error, > 1509 EINVAL, > 1510 RTE_TM_ERROR_TYPE_UNSPECIFIED, > 1511 NULL, > 1512 rte_strerror(EINVAL)); > else_branch: The else branch, identical to the then branch. > 1513 } else { > 1514 return -rte_tm_error_set(error, > 1515 EINVAL, > 1516 RTE_TM_ERROR_TYPE_UNSPECIFIED, > 1517 NULL, > 1518 rte_strerror(EINVAL)); > 1519 } >=20 > Coverity issue: 337928 > Fixes: c820468ac99c ("net/ipn3ke: support TM") > Cc: rosen.xu@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Kevin Traynor > --- > drivers/net/ipn3ke/ipn3ke_tm.c | 6 ------ > 1 file changed, 6 deletions(-) >=20 > diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c > b/drivers/net/ipn3ke/ipn3ke_tm.c index adf02c157..a93145d59 100644 > --- a/drivers/net/ipn3ke/ipn3ke_tm.c > +++ b/drivers/net/ipn3ke/ipn3ke_tm.c > @@ -1511,10 +1511,4 @@ ipn3ke_tm_hierarchy_commit_check(struct > rte_eth_dev *dev, > NULL, > rte_strerror(EINVAL)); > - } else { > - return -rte_tm_error_set(error, > - EINVAL, > - > RTE_TM_ERROR_TYPE_UNSPECIFIED, > - NULL, > - rte_strerror(EINVAL)); > } > } > -- > 2.21.0 Reviewed-by: Rosen Xu