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 A55CDA0471 for ; Tue, 16 Jul 2019 13:50:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 239BD2C18; Tue, 16 Jul 2019 13:50:01 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 839802AB for ; Tue, 16 Jul 2019 13:49:59 +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 fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2019 04:49:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,498,1557212400"; d="scan'208";a="175382241" Received: from npg-dpdk-xiao-1.sh.intel.com ([10.67.111.145]) by FMSMGA003.fm.intel.com with ESMTP; 16 Jul 2019 04:49:58 -0700 From: Xiao Wang To: qi.z.zhang@intel.com Cc: dev@dpdk.org, Xiao Wang Date: Tue, 16 Jul 2019 19:31:07 +0800 Message-Id: <20190716113107.32868-1-xiao.w.wang@intel.com> X-Mailer: git-send-email 2.15.1 Subject: [dpdk-dev] [PATCH] net/ifc: add devargs pointer check 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" We need to check devargs pointer before dereference it, if no devargs specified then this driver just skips the device. Fixes: 40ef35f4a504 ("net/ifc: detect if VDPA mode is specified") Signed-off-by: Xiao Wang --- drivers/net/ifc/ifcvf_vdpa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c index e59084034..8de9ef199 100644 --- a/drivers/net/ifc/ifcvf_vdpa.c +++ b/drivers/net/ifc/ifcvf_vdpa.c @@ -1114,6 +1114,9 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; + if (!pci_dev->device.devargs) + return 1; + kvlist = rte_kvargs_parse(pci_dev->device.devargs->args, ifcvf_valid_arguments); if (kvlist == NULL) -- 2.15.1