From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2B881A0A02; Thu, 14 Jan 2021 08:53:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15D40140FCC; Thu, 14 Jan 2021 08:53:24 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 9F5CD140FBC for ; Thu, 14 Jan 2021 08:53:22 +0100 (CET) IronPort-SDR: D6ymoZdRDZM5wMHyZ7VvcrgcIG10/HjEY3w193DqZTvyH+08+qOqDQtyg4FU83VPUof0NPs9qp z533+WC5Fw2A== X-IronPort-AV: E=McAfee;i="6000,8403,9863"; a="174816730" X-IronPort-AV: E=Sophos;i="5.79,346,1602572400"; d="scan'208";a="174816730" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2021 23:53:21 -0800 IronPort-SDR: 9M/xRnpZb6/32ntvvdHtRw1GugQY94/cP+V5nWpgVO6uMRLT6sf2TUjDNNjpcNiQVDKW3wxKJT S7mXavSMQ5fQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,346,1602572400"; d="scan'208";a="382178655" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga008.jf.intel.com with ESMTP; 13 Jan 2021 23:53:21 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 13 Jan 2021 23:53:20 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 14 Jan 2021 15:53:18 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Thu, 14 Jan 2021 15:53:18 +0800 From: "Zhang, Qi Z" To: "Su, Simei" CC: "dev@dpdk.org" , "Guo, Junfeng" , "Guo, Jia" , "Cao, Yahui" Thread-Topic: [PATCH] net/iavf: fix null pointer dereference Thread-Index: AQHW6jctnBLp6mVqBkq1vxkU4ZDMc6omvzRQ Date: Thu, 14 Jan 2021 07:53:18 +0000 Message-ID: <98cabc6a021b4a7b9d14533799702f2e@intel.com> References: <20210114052324.393980-1-simei.su@intel.com> In-Reply-To: <20210114052324.393980-1-simei.su@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/iavf: fix null pointer dereference X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" > -----Original Message----- > From: Su, Simei > Sent: Thursday, January 14, 2021 1:23 PM > To: Zhang, Qi Z > Cc: dev@dpdk.org; Guo, Junfeng ; Guo, Jia > ; Cao, Yahui ; Su, Simei > > Subject: [PATCH] net/iavf: fix null pointer dereference >=20 > A pointer has already been dereferenced before checking if it is NULL. > It doesn't make any sense, so correct to avoid it. >=20 > Fixes: 4f3cfcbc3df3 ("net/iavf: support eCPRI msg type 0 for RSS") Coveri= ty issue: > 365290 >=20 > Signed-off-by: Simei Su > --- > drivers/net/iavf/iavf_hash.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c = index > ebaac58..9901f4b 100644 > --- a/drivers/net/iavf/iavf_hash.c > +++ b/drivers/net/iavf/iavf_hash.c > @@ -597,11 +597,13 @@ iavf_hash_parse_pattern(const struct rte_flow_item > pattern[], uint64_t *phint, > break; > case RTE_FLOW_ITEM_TYPE_ECPRI: > ecpri =3D item->spec; > - ecpri_common.u32 =3D rte_be_to_cpu_32( > - ecpri->hdr.common.u32); > if (!ecpri) > break; > - else if (ecpri_common.type !=3D > + > + ecpri_common.u32 =3D rte_be_to_cpu_32( > + ecpri->hdr.common.u32); patchwork warning CHECK:OPEN_ENDED_LINE for above code=20 As we have 100 char line limit now, the wrap is not necessary. Acked-by: Qi Zhang Applied to dpdk-next-net-intel after capture above fix. Thanks Qi