From: Xiao Wang <xiao.w.wang@intel.com>
To: qi.z.zhang@intel.com
Cc: dev@dpdk.org, Xiao Wang <xiao.w.wang@intel.com>
Subject: [dpdk-dev] [PATCH] net/ifc: add devargs pointer check
Date: Tue, 16 Jul 2019 19:31:07 +0800 [thread overview]
Message-ID: <20190716113107.32868-1-xiao.w.wang@intel.com> (raw)
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
next reply other threads:[~2019-07-16 11:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-16 11:31 Xiao Wang [this message]
2019-07-17 2:28 ` Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190716113107.32868-1-xiao.w.wang@intel.com \
--to=xiao.w.wang@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).