From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TCsZVVqoLX9ZNynEmj9Mx67s3fmMuRhj80ZfvY0KNpQ=; b=sfNRman4cFxtOl5Pzl6nlEOYGs4VgyDXBiwCBlU2xUN1TaARuI9yVXI9MMvmIVFbcR thNtjY0aYbPbXh10g/zt4XQlufq2ldnMbZV1wZPEwxybUpLN50RjDaeDDUME349kRSbh WYbcBySVf8Q5li9aUKta6T59XjM2e9kw5GL9DKg8Dj3L57smslLfAkRy5JDpCCNPIXHd fKvYFpuJ+2rb7eJVt1cJKKYQI0u4KLc1MugGZlZUj7OFuniKc16RyijjLJEIGDJjf+nb 9HikQpjThrp0atu3Yt0H+pV0giMhkQHjJQPxHdFbhR3DHASUunNjca1dGrYR2S3eao/6 AKLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TCsZVVqoLX9ZNynEmj9Mx67s3fmMuRhj80ZfvY0KNpQ=; b=BOTMl6+89TMSU+pv9v5FfTyeVaMQQXBIFjFTKAO4dOAx06hsmqL/GS2S+xKGPJjwMU iJV7Y5JD+dI0rri2qrQvD7x3sTHo4WoHNfZywrQV4NtrO7XvN+mS7iWGwfPEvtE3QSpo tXYKUasP3emG/QB0tZD3gMiue/Sx6/kIB0MaU18CHvxDRsMaP5yA/g6yAC7cRFJ9bMWq v4/9h5RxKKx319lSOQ9ee4MKXVei5uXZLDsZDRy0Og6G/ucKGzV2JLkEbFwOaXGZ0ipa 06bLnKefdFuelS4wdjq19t8dczIrkGpunt2QH/b3Ri4WGLThBm6Stz2jYIzZmnaEFvOP M7Og== X-Gm-Message-State: AOPr4FU1PfjejnE+aaBZVsX6P/H5OuuDufB0cRBO+r/b759kDb9Ki73/8TR28MN/R5ErXw== X-Received: by 10.98.100.200 with SMTP id y191mr21747797pfb.84.1461255007661; Thu, 21 Apr 2016 09:10:07 -0700 (PDT) Received: from xeon-e3 (static-50-53-72-186.bvtn.or.frontiernet.net. [50.53.72.186]) by smtp.gmail.com with ESMTPSA id q26sm2140460pfi.57.2016.04.21.09.10.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Apr 2016 09:10:07 -0700 (PDT) Date: Thu, 21 Apr 2016 09:10:19 -0700 From: Stephen Hemminger To: Helin Zhang Cc: dev@dpdk.org Message-ID: <20160421091019.348a1777@xeon-e3> In-Reply-To: <1461210177-29330-2-git-send-email-helin.zhang@intel.com> 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 Subject: Re: [dpdk-dev] [PATCH 1/6] i40e: fix problematic dereference X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 16:10:08 -0000 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?