DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: fix NULL device argument pointer reference
@ 2018-10-22  6:15 Qi Zhang
  2018-10-22  7:30 ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Qi Zhang @ 2018-10-22  6:15 UTC (permalink / raw)
  To: thomas; +Cc: dev, Qi Zhang

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

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

* Re: [dpdk-dev] [PATCH] eal: fix NULL device argument pointer reference
  2018-10-22  6:15 [dpdk-dev] [PATCH] eal: fix NULL device argument pointer reference Qi Zhang
@ 2018-10-22  7:30 ` Thomas Monjalon
  2018-10-22 10:47   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2018-10-22  7:30 UTC (permalink / raw)
  To: Qi Zhang; +Cc: dev

22/10/2018 08:15, Qi Zhang:
> 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.

It is not really specific to PCI device.
The devargs is not initialized if the device is probed by default policy
(i.e. not in blacklist).

I think we can say that "devargs is not always initialized".

> Fixes: 244d5130719c ("eal: enable hotplug on multi-process")
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

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

* Re: [dpdk-dev] [PATCH] eal: fix NULL device argument pointer reference
  2018-10-22  7:30 ` Thomas Monjalon
@ 2018-10-22 10:47   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-10-22 10:47 UTC (permalink / raw)
  To: Qi Zhang; +Cc: dev

22/10/2018 09:30, Thomas Monjalon:
> 22/10/2018 08:15, Qi Zhang:
> > 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.
> 
> It is not really specific to PCI device.
> The devargs is not initialized if the device is probed by default policy
> (i.e. not in blacklist).
> 
> I think we can say that "devargs is not always initialized".
> 
> > Fixes: 244d5130719c ("eal: enable hotplug on multi-process")
> > 
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

Applied with following text:

eal: fix bus name read for removal in multi-process

A crash may appear when removing some PCI devices because
dev->devargs is not always initialized. So use dev->bus instead of
dev->devargs->bus when building devargs string to remove a device.

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

end of thread, other threads:[~2018-10-22 10:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-22  6:15 [dpdk-dev] [PATCH] eal: fix NULL device argument pointer reference Qi Zhang
2018-10-22  7:30 ` Thomas Monjalon
2018-10-22 10:47   ` Thomas Monjalon

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