summaryrefslogtreecommitdiff
path: root/drivers/net/failsafe/failsafe_eal.c
diff options
context:
space:
mode:
authorRaslan Darawsheh <rasland@mellanox.com>2017-08-29 12:08:08 +0300
committerFerruh Yigit <ferruh.yigit@intel.com>2017-10-06 02:49:47 +0200
commit6969a22bf6ee18d8f34990688194aef4bad3a19c (patch)
tree3ea5f3ad9233c6f9224c1ab90e830e20ba1ecf05 /drivers/net/failsafe/failsafe_eal.c
parentcfd662d22e7bddb4ba41dbd1384f8497f38c2b4e (diff)
downloaddpdk-next-eventdev-6969a22bf6ee18d8f34990688194aef4bad3a19c.zip
dpdk-next-eventdev-6969a22bf6ee18d8f34990688194aef4bad3a19c.tar.gz
dpdk-next-eventdev-6969a22bf6ee18d8f34990688194aef4bad3a19c.tar.xz
net/failsafe: fix failsafe bus uninit return value
fs_bus_uninit is always returning 0 no matter what was the status of each sub device bus_uninit value. Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD") Cc: stable@dpdk.org Signed-off-by: Raslan Darawsheh <rasland@mellanox.com> Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Diffstat (limited to 'drivers/net/failsafe/failsafe_eal.c')
-rw-r--r--drivers/net/failsafe/failsafe_eal.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c
index c8f4318..aeb87a0 100644
--- a/drivers/net/failsafe/failsafe_eal.c
+++ b/drivers/net/failsafe/failsafe_eal.c
@@ -90,19 +90,20 @@ fs_bus_uninit(struct rte_eth_dev *dev)
{
struct sub_device *sdev = NULL;
uint8_t i;
- int ret;
+ int sdev_ret;
+ int ret = 0;
FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {
- ret = rte_eal_hotplug_remove(sdev->bus->name,
- sdev->dev->name);
- if (ret) {
- ERROR("Failed to remove requested device %s",
- sdev->dev->name);
+ sdev_ret = rte_eal_hotplug_remove(sdev->bus->name,
+ sdev->dev->name);
+ if (sdev_ret) {
+ ERROR("Failed to remove requested device %s (err: %d)",
+ sdev->dev->name, sdev_ret);
continue;
}
sdev->state = DEV_PROBED - 1;
}
- return 0;
+ return ret;
}
int
@@ -111,8 +112,6 @@ failsafe_eal_uninit(struct rte_eth_dev *dev)
int ret;
ret = fs_bus_uninit(dev);
- if (ret)
- return ret;
PRIV(dev)->state = DEV_PROBED - 1;
- return 0;
+ return ret;
}