From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D838FA05D3 for ; Wed, 22 May 2019 09:10:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 68CF84F91; Wed, 22 May 2019 09:10:28 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 0774B14EC; Wed, 22 May 2019 09:10:26 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 May 2019 00:10:26 -0700 X-ExtLoop1: 1 Received: from dipei-st-npg.sh.intel.com ([10.67.110.220]) by orsmga005.jf.intel.com with ESMTP; 22 May 2019 00:10:24 -0700 From: Andy Pei To: web@dpdk.org Cc: andy.pei@intel.com, rosen.xu@intel.com, stable@dpdk.org Date: Wed, 22 May 2019 15:04:42 +0800 Message-Id: <1558508682-429612-1-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-web] [PATCH] net/ipn3ke: check input arguement before other operation X-BeenThere: web@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK website maintenance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: web-bounces@dpdk.org Sender: "web" check input arguement rte_eth_dev *ethdev, ensuring ethdev is not NULl before operation on ethdev. Coverity issue: 337922 Fixes: 70d6b7f550f4 ("net/ipn3ke: add representor") Cc: rosen.xu@intel.com Cc: stable@dpdk.org Signed-off-by: Andy Pei --- drivers/net/ipn3ke/ipn3ke_representor.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c index cf3b214..32d4fc8 100644 --- a/drivers/net/ipn3ke/ipn3ke_representor.c +++ b/drivers/net/ipn3ke/ipn3ke_representor.c @@ -735,13 +735,16 @@ enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg) { - struct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(ethdev); - struct ipn3ke_rpst *rpst = IPN3KE_DEV_PRIVATE_TO_RPST(ethdev); int ret = 0; + struct ipn3ke_hw *hw = NULL; + struct ipn3ke_rpst *rpst = NULL; if (ethdev == NULL) return -EINVAL; + hw = IPN3KE_DEV_PRIVATE_TO_HW(ethdev); + rpst = IPN3KE_DEV_PRIVATE_TO_RPST(ethdev); + if (hw->acc_flow) switch (filter_type) { case RTE_ETH_FILTER_GENERIC: -- 1.8.3.1