Skip to contentSkip to conversation

net/ifc: add devargs pointer check

PATCH Applied Xiao Wang 2 participants 2 messages Jul 16, 2019 – Jul 17, 2019 Network drivers

lore
Share & tools
lore

Xiao Wang

author
#0 lore raw

PATCH 1/1 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")
---
 drivers/net/ifc/ifcvf_vdpa.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ifc/ifcvf_vdpa.c +3 -0
index e59084034..8de9ef199 100644
@@ -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)
Signature · 1 line
2.15.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 9 lines

-----Original Message-----
From: Wang, Xiao W
Sent: Tuesday, July 16, 2019 7:31 PM
To: Zhang, Qi Z <[email protected]>
Cc: [email protected]; Wang, Xiao W <[email protected]>
Subject: [PATCH] net/ifc: add devargs pointer check

Quoted 7 lines

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

---

Applied to dpdk-next-net-intel

Thanks
Qi