aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_eal/common/eal_common_dev.c
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2018-11-27 10:44:39 +0000
committerLuca Boccassi <luca.boccassi@gmail.com>2018-11-27 10:45:47 +0000
commita4f0fa29488e582ab8b5ef9db475b3d26ded690c (patch)
treede163f35a726d518a3f93ab6ee4ac25b8982635d /lib/librte_eal/common/eal_common_dev.c
parent29058550643267a554e0368806dece63b047c5cb (diff)
New upstream version 18.11upstream/18.11upstream
Change-Id: I6c63198045de1e34fda8a7b4665d89d5f4a20d20 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'lib/librte_eal/common/eal_common_dev.c')
-rw-r--r--lib/librte_eal/common/eal_common_dev.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c
index 1fdc9ab1..fd7f5ca7 100644
--- a/lib/librte_eal/common/eal_common_dev.c
+++ b/lib/librte_eal/common/eal_common_dev.c
@@ -166,18 +166,20 @@ local_dev_probe(const char *devargs, struct rte_device **new_dev)
ret = -ENODEV;
goto err_devarg;
}
+ /* Since there is a matching device, it is now its responsibility
+ * to manage the devargs we've just inserted. From this point
+ * those devargs shouldn't be removed manually anymore.
+ */
ret = dev->bus->plug(dev);
- if (ret) {
- if (rte_dev_is_probed(dev)) /* if already succeeded earlier */
- return ret; /* no rollback */
+ if (ret && !rte_dev_is_probed(dev)) { /* if hasn't ever succeeded */
RTE_LOG(ERR, EAL, "Driver cannot attach the device (%s)\n",
dev->name);
- goto err_devarg;
+ return ret;
}
*new_dev = dev;
- return 0;
+ return ret;
err_devarg:
if (rte_devargs_remove(da) != 0) {