From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH 1/6] i40e: fix problematic dereference Date: Thu, 21 Apr 2016 09:10:19 -0700 Message-ID: <20160421091019.348a1777@xeon-e3> References: <1461210177-29330-1-git-send-email-helin.zhang@intel.com> <1461210177-29330-2-git-send-email-helin.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Helin Zhang Return-path: Received: from mail-pf0-f177.google.com (mail-pf0-f177.google.com [209.85.192.177]) by dpdk.org (Postfix) with ESMTP id 42D9BE6D for ; Thu, 21 Apr 2016 18:10:08 +0200 (CEST) Received: by mail-pf0-f177.google.com with SMTP id n1so31615249pfn.2 for ; Thu, 21 Apr 2016 09:10:08 -0700 (PDT) In-Reply-To: <1461210177-29330-2-git-send-email-helin.zhang@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, 21 Apr 2016 11:42:52 +0800 Helin Zhang wrote: > Fix issue reported by Coverity. > > Coverity ID 119267: Dereference before null check. > > Fixes: 8e109464c022 ("i40e: allow vector Rx and Tx usage") > > Signed-off-by: Helin Zhang > --- > drivers/net/i40e/i40e_rxtx.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c > index 4d35d83..9c126a3 100644 > --- a/drivers/net/i40e/i40e_rxtx.c > +++ b/drivers/net/i40e/i40e_rxtx.c > @@ -2592,14 +2592,14 @@ i40e_rx_queue_release_mbufs(struct i40e_rx_queue *rxq) > { > uint16_t i; > > - /* SSE Vector driver has a different way of releasing mbufs. */ > - if (rxq->rx_using_sse) { > - i40e_rx_queue_release_mbufs_vec(rxq); > + if (!rxq || !rxq->sw_ring) { > + PMD_DRV_LOG(DEBUG, "Pointer to rxq or sw_ring is NULL"); > return; > } > I can't see how you could ever trigger this. i40e_rx_queue_release_mbufs() is called only called from places where rxq is guraanteed non NULL. Are you sure Coverity isn't tell you that?