From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5A82A47CE for ; Thu, 21 Apr 2016 05:43:21 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 20 Apr 2016 20:43:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,512,1455004800"; d="scan'208";a="689678811" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 20 Apr 2016 20:43:05 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u3L3h3WN027716; Thu, 21 Apr 2016 11:43:03 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u3L3h0YG029462; Thu, 21 Apr 2016 11:43:02 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u3L3h06s029436; Thu, 21 Apr 2016 11:43:00 +0800 From: Helin Zhang To: dev@dpdk.org Cc: Helin Zhang Date: Thu, 21 Apr 2016 11:42:52 +0800 Message-Id: <1461210177-29330-2-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1461210177-29330-1-git-send-email-helin.zhang@intel.com> References: <1461210177-29330-1-git-send-email-helin.zhang@intel.com> Subject: [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 03:43:21 -0000 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; } - if (!rxq || !rxq->sw_ring) { - PMD_DRV_LOG(DEBUG, "Pointer to rxq or sw_ring is NULL"); + /* SSE Vector driver has a different way of releasing mbufs. */ + if (rxq->rx_using_sse) { + i40e_rx_queue_release_mbufs_vec(rxq); return; } -- 2.5.0