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 09F39A00E6 for ; Mon, 5 Aug 2019 11:15:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4C7B01BDEE; Mon, 5 Aug 2019 11:15:43 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 9585D1B9D6 for ; Mon, 5 Aug 2019 11:15:41 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Aug 2019 02:15:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,349,1559545200"; d="scan'208";a="181626159" Received: from yexl-server.sh.intel.com ([10.67.117.5]) by FMSMGA003.fm.intel.com with ESMTP; 05 Aug 2019 02:15:39 -0700 From: Xiaolong Ye To: Qiming Yang , Wenzhuo Lu Cc: dev@dpdk.org, Xiaolong Ye , ying.a.wang@intel.com Date: Mon, 5 Aug 2019 17:15:11 +0800 Message-Id: <20190805091511.64965-1-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <“20190805073923.62812-1-xiaolong.ye@intel.com”> References: <“20190805073923.62812-1-xiaolong.ye@intel.com”> Subject: [dpdk-dev] [PATCH v2] net/ice: fix potential null pointer dereferences 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" This patch fixes two null pointer dereferences in flow code detected by coverity scan. Coverity issue: 345815, 345816 Fixes: 94f00800d78b ("net/ice: fix VXLAN/NVGRE flow matching") Cc: ying.a.wang@intel.com Signed-off-by: Xiaolong Ye --- v2 change: - add coverity ids drivers/net/ice/ice_generic_flow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c index 5fcf4289c..1c0adc779 100644 --- a/drivers/net/ice/ice_generic_flow.c +++ b/drivers/net/ice/ice_generic_flow.c @@ -464,7 +464,7 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], "Invalid VXLAN item"); return 0; } - if (vxlan_mask->vni[0] == UINT8_MAX && + if (vxlan_mask && vxlan_mask->vni[0] == UINT8_MAX && vxlan_mask->vni[1] == UINT8_MAX && vxlan_mask->vni[2] == UINT8_MAX) input_set |= ICE_INSET_TUN_ID; @@ -486,7 +486,7 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], "Invalid NVGRE item"); return 0; } - if (nvgre_mask->tni[0] == UINT8_MAX && + if (nvgre_mask && nvgre_mask->tni[0] == UINT8_MAX && nvgre_mask->tni[1] == UINT8_MAX && nvgre_mask->tni[2] == UINT8_MAX) input_set |= ICE_INSET_TUN_ID; -- 2.17.1