From: Qi Zhang <qi.z.zhang@intel.com>
To: thomas@monjalon.net
Cc: dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>
Subject: [dpdk-dev] [PATCH] eal: fix NULL device argument pointer reference
Date: Mon, 22 Oct 2018 14:15:16 +0800 [thread overview]
Message-ID: <20181022061516.45912-1-qi.z.zhang@intel.com> (raw)
dev->devargs is not initialized for PCI device, so use dev->bus to
replace dev->devargs->bus to avoid segment fault when hotplug remove
a PCI device.
Fixes: 244d5130719c ("eal: enable hotplug on multi-process")
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
lib/librte_eal/common/eal_common_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c
index d4b1ea70d..9d456d320 100644
--- a/lib/librte_eal/common/eal_common_dev.c
+++ b/lib/librte_eal/common/eal_common_dev.c
@@ -393,7 +393,7 @@ rte_dev_remove(struct rte_device *dev)
return -ENOENT;
}
- ret = build_devargs(dev->devargs->bus->name, dev->name, "", &devargs);
+ ret = build_devargs(dev->bus->name, dev->name, "", &devargs);
if (ret != 0)
return ret;
--
2.13.6
next reply other threads:[~2018-10-22 6:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-22 6:15 Qi Zhang [this message]
2018-10-22 7:30 ` Thomas Monjalon
2018-10-22 10:47 ` Thomas Monjalon
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=20181022061516.45912-1-qi.z.zhang@intel.com \
--to=qi.z.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/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).