From: Xiao Wang Date: Tue, 16 Jul 2019 11:31:07 +0000 (+0800) Subject: net/ifc: add devargs pointer check X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=66c303bddfff5fff8a71bed2830fb6e8b0a144b6;p=dpdk.git net/ifc: add devargs pointer check 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") Cc: stable@dpdk.org Signed-off-by: Xiao Wang Acked-by: Qi Zhang --- diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c index e590840345..8de9ef1999 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)