DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ifc: add devargs pointer check
@ 2019-07-16 11:31 Xiao Wang
  2019-07-17  2:28 ` Zhang, Qi Z
  0 siblings, 1 reply; 2+ messages in thread
From: Xiao Wang @ 2019-07-16 11:31 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev, Xiao Wang

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 <xiao.w.wang@intel.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ifc: add devargs pointer check
  2019-07-16 11:31 [dpdk-dev] [PATCH] net/ifc: add devargs pointer check Xiao Wang
@ 2019-07-17  2:28 ` Zhang, Qi Z
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2019-07-17  2:28 UTC (permalink / raw)
  To: Wang, Xiao W; +Cc: dev



> -----Original Message-----
> From: Wang, Xiao W
> Sent: Tuesday, July 16, 2019 7:31 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Wang, Xiao W <xiao.w.wang@intel.com>
> Subject: [PATCH] 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")
> 
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> ---

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel

Thanks
Qi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-17  2:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-16 11:31 [dpdk-dev] [PATCH] net/ifc: add devargs pointer check Xiao Wang
2019-07-17  2:28 ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).