From patchwork Thu Jul 27 07:28:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuba Kozak X-Patchwork-Id: 27237 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 6482C7D8B; Thu, 27 Jul 2017 09:36:46 +0200 (CEST) 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-dev] [PATCH] net/i40e: fix dereferencing null pointer 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" 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 Acked-by: Jingjing Wu --- 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)