From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 1034C7D7E; Thu, 27 Jul 2017 09:36:43 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jul 2017 00:36:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,419,1496127600"; d="scan'208";a="1176919058" Received: from gklab-246-072.igk.intel.com (HELO Sent) ([10.217.246.72]) by fmsmga001.fm.intel.com with SMTP; 27 Jul 2017 00:36:11 -0700 Received: by Sent (sSMTP sendmail emulation); Thu, 27 Jul 2017 09:28:25 +0200 From: Kuba Kozak To: jingjing.wu@intel.com Cc: dev@dpdk.org, deepak.k.jain@intel.com, michalx.k.jastrzebski@intel.com, Kuba Kozak , stable@dpdk.org Date: Thu, 27 Jul 2017 09:28:22 +0200 Message-Id: <1501140502-155485-1-git-send-email-kubax.kozak@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-stable] [PATCH] net/i40e: fix dereferencing null pointer X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jul 2017 07:36:44 -0000 Add check if o_vlan_mask and i_vlan_mask are not a NULL pointer. Coverity issue: 143448 Coverity issue: 143449 Fixes: d37705068ee8 ("net/i40e: parse QinQ pattern") Cc: stable@dpdk.org Signed-off-by: Kuba Kozak --- drivers/net/i40e/i40e_flow.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 95af701..b92719a 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -3719,8 +3719,10 @@ i40e_flow_parse_qinq_pattern(__rte_unused struct rte_eth_dev *dev, } /* Get filter specification */ - if ((o_vlan_mask->tci == rte_cpu_to_be_16(I40E_TCI_MASK)) && - (i_vlan_mask->tci == rte_cpu_to_be_16(I40E_TCI_MASK))) { + if ((o_vlan_mask != NULL) && (o_vlan_mask->tci == + rte_cpu_to_be_16(I40E_TCI_MASK)) && + (i_vlan_mask != NULL) && + (i_vlan_mask->tci == rte_cpu_to_be_16(I40E_TCI_MASK))) { filter->outer_vlan = rte_be_to_cpu_16(o_vlan_spec->tci) & I40E_TCI_MASK; filter->inner_vlan = rte_be_to_cpu_16(i_vlan_spec->tci) -- 2.7.4