DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] dev: don't remove devargs that are still referenced
@ 2018-11-21 18:37 Darek Stojaczyk
  2018-11-21 18:55 ` Thomas Monjalon
  2018-11-21 19:38 ` [dpdk-dev] [PATCH v2] " Darek Stojaczyk
  0 siblings, 2 replies; 9+ messages in thread
From: Darek Stojaczyk @ 2018-11-21 18:37 UTC (permalink / raw)
  To: dev; +Cc: Darek Stojaczyk, gaetan.rivet

Even if a device failed to plug, it's still a device
object that references the devargs. Those devargs will
be freed automatically together with the device, but
can't be freed any earlier.

Fixes: 7e8b26650146 ("eal: fix hotplug add / remove")
Cc: gaetan.rivet@6wind.com

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
---
 lib/librte_eal/common/eal_common_dev.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c
index 1fdc9ab17..b6fc5e437 100644
--- a/lib/librte_eal/common/eal_common_dev.c
+++ b/lib/librte_eal/common/eal_common_dev.c
@@ -169,11 +169,10 @@ local_dev_probe(const char *devargs, struct rte_device **new_dev)
 
 	ret = dev->bus->plug(dev);
 	if (ret) {
-		if (rte_dev_is_probed(dev)) /* if already succeeded earlier */
-			return ret; /* no rollback */
-		RTE_LOG(ERR, EAL, "Driver cannot attach the device (%s)\n",
-			dev->name);
-		goto err_devarg;
+		if (!rte_dev_is_probed(dev)) /* if hasn't succeeded earlier */
+			RTE_LOG(ERR, EAL, "Driver cannot attach the device (%s)\n",
+				dev->name);
+		return ret;
 	}
 
 	*new_dev = dev;
-- 
2.17.1

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

end of thread, other threads:[~2018-11-25 12:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-21 18:37 [dpdk-dev] [PATCH] dev: don't remove devargs that are still referenced Darek Stojaczyk
2018-11-21 18:55 ` Thomas Monjalon
2018-11-21 19:38 ` [dpdk-dev] [PATCH v2] " Darek Stojaczyk
2018-11-22  9:54   ` Gaëtan Rivet
2018-11-22 12:54     ` Stojaczyk, Dariusz
2018-11-23 15:43   ` [dpdk-dev] [PATCH v3] " Darek Stojaczyk
2018-11-23 17:04     ` Maxime Coquelin
2018-11-23 21:45       ` Stojaczyk, Dariusz
2018-11-25 12:46       ` 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).