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 51A7DA0471 for ; Mon, 15 Jul 2019 04:45:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 10D764CE4; Mon, 15 Jul 2019 04:45:50 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 329783772 for ; Mon, 15 Jul 2019 04:45:47 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jul 2019 19:45:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,492,1557212400"; d="scan'208";a="318550100" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 14 Jul 2019 19:45:46 -0700 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 14 Jul 2019 19:45:46 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 14 Jul 2019 19:45:39 -0700 Received: from shsmsx105.ccr.corp.intel.com ([169.254.11.232]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.240]) with mapi id 14.03.0439.000; Mon, 15 Jul 2019 10:45:38 +0800 From: "Zhang, Xiao" To: "Yang, Qiming" , "dev@dpdk.org" CC: "Zhang, Qi Z" , "Wang, Xiao W" , "Xing, Beilei" , "Lu, Wenzhuo" Thread-Topic: [DPDK] drivers/net: fix dereference after null check coverity Thread-Index: AQHVOIWSHQvJ8XREfkyMSzORezk1qKbKdSAAgACH4kA= Date: Mon, 15 Jul 2019 02:45:37 +0000 Message-ID: References: <1562949587-8308-1-git-send-email-xiao.zhang@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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-dev] [DPDK] drivers/net: fix dereference after null check coverity 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" Hi Qiming, I will update the commit log. Thanks, Xiao > -----Original Message----- > From: Yang, Qiming > Sent: Monday, July 15, 2019 10:37 AM > To: Zhang, Xiao ; dev@dpdk.org > Cc: Zhang, Qi Z ; Wang, Xiao W > ; Xing, Beilei ; Lu, Wenzhu= o > > Subject: RE: [DPDK] drivers/net: fix dereference after null check coverit= y >=20 > Hi, Xiao > Please explain what's the issue you fixed in the commit log. > And for the fix patch, fix line is needed, please refer to other merged = patches. > commit e0474b94f8a36672d66be7408e3f7cf00e302329 is a good reference. >=20 > Qiming > -----Original Message----- > From: Zhang, Xiao > Sent: Saturday, July 13, 2019 12:40 AM > To: dev@dpdk.org > Cc: Zhang, Qi Z ; Wang, Xiao W > ; Xing, Beilei ; Lu, Wenzhu= o > ; Yang, Qiming ; Ananyev, > Konstantin ; Wu, Jingjing > ; Zhang, Xiao > Subject: [DPDK] drivers/net: fix dereference after null check coverity >=20 > This patch tries to fix the coverity issues of dereference after null che= ck. >=20 > Coverity issue: 343452 > Coverity issue: 343447 > Coverity issue: 343422 > Coverity issue: 343416 > Coverity issue: 343407 > Coverity issue: 343403 > Coverity issue: 13245 >=20 > Signed-off-by: Xiao Zhang > --- > drivers/net/fm10k/fm10k_rxtx_vec.c | 3 +++ > drivers/net/i40e/i40e_rxtx_vec_common.h | 3 +++ > drivers/net/iavf/iavf_rxtx_vec_common.h | 3 +++ > drivers/net/ice/ice_rxtx_vec_common.h | 3 +++ > drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 3 +++ > 5 files changed, 15 insertions(+) >=20 > diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c > b/drivers/net/fm10k/fm10k_rxtx_vec.c > index 788e248..cb840de 100644 > --- a/drivers/net/fm10k/fm10k_rxtx_vec.c > +++ b/drivers/net/fm10k/fm10k_rxtx_vec.c > @@ -602,6 +602,9 @@ fm10k_reassemble_packets(struct fm10k_rx_queue > *rxq, > struct rte_mbuf *end =3D rxq->pkt_last_seg; > unsigned pkt_idx, buf_idx; >=20 > + if (!start) > + return 0; > + > for (buf_idx =3D 0, pkt_idx =3D 0; buf_idx < nb_bufs; buf_idx++) { > if (end !=3D NULL) { > /* processing a split packet */ > diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h > b/drivers/net/i40e/i40e_rxtx_vec_common.h > index 0e6ffa0..1351e41 100644 > --- a/drivers/net/i40e/i40e_rxtx_vec_common.h > +++ b/drivers/net/i40e/i40e_rxtx_vec_common.h > @@ -20,6 +20,9 @@ reassemble_packets(struct i40e_rx_queue *rxq, struct > rte_mbuf **rx_bufs, > struct rte_mbuf *end =3D rxq->pkt_last_seg; > unsigned pkt_idx, buf_idx; >=20 > + if (!start) > + return 0; > + > for (buf_idx =3D 0, pkt_idx =3D 0; buf_idx < nb_bufs; buf_idx++) { > if (end !=3D NULL) { > /* processing a split packet */ > diff --git a/drivers/net/iavf/iavf_rxtx_vec_common.h > b/drivers/net/iavf/iavf_rxtx_vec_common.h > index db509d7..ac3d62a 100644 > --- a/drivers/net/iavf/iavf_rxtx_vec_common.h > +++ b/drivers/net/iavf/iavf_rxtx_vec_common.h > @@ -20,6 +20,9 @@ reassemble_packets(struct iavf_rx_queue *rxq, struct > rte_mbuf **rx_bufs, > struct rte_mbuf *end =3D rxq->pkt_last_seg; > unsigned int pkt_idx, buf_idx; >=20 > + if (!start) > + return 0; > + > for (buf_idx =3D 0, pkt_idx =3D 0; buf_idx < nb_bufs; buf_idx++) { > if (end) { > /* processing a split packet */ > diff --git a/drivers/net/ice/ice_rxtx_vec_common.h > b/drivers/net/ice/ice_rxtx_vec_common.h > index c5f0d56..11da521 100644 > --- a/drivers/net/ice/ice_rxtx_vec_common.h > +++ b/drivers/net/ice/ice_rxtx_vec_common.h > @@ -16,6 +16,9 @@ ice_rx_reassemble_packets(struct ice_rx_queue *rxq, > struct rte_mbuf **rx_bufs, > struct rte_mbuf *end =3D rxq->pkt_last_seg; > unsigned int pkt_idx, buf_idx; >=20 > + if (!start) > + return 0; > + > for (buf_idx =3D 0, pkt_idx =3D 0; buf_idx < nb_bufs; buf_idx++) { > if (end) { > /* processing a split packet */ > diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h > b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h > index a97c271..a95cc0a 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h > +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h > @@ -19,6 +19,9 @@ reassemble_packets(struct ixgbe_rx_queue *rxq, struct > rte_mbuf **rx_bufs, > struct rte_mbuf *end =3D rxq->pkt_last_seg; > unsigned int pkt_idx, buf_idx; >=20 > + if (!start) > + return 0; > + > for (buf_idx =3D 0, pkt_idx =3D 0; buf_idx < nb_bufs; buf_idx++) { > if (end !=3D NULL) { > /* processing a split packet */ > -- > 2.7.4