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 <xiao.w.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
This commit is contained in:
Xiao Wang 2019-07-16 19:31:07 +08:00 committed by Ferruh Yigit
parent 9c27a91018
commit 66c303bddf

View File

@ -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)