All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/failsafe: fix failsafe bus uninit return value
@ 2017-08-29  7:51 Raslan Darawsheh
  2017-08-29  8:18 ` Gaëtan Rivet
  0 siblings, 1 reply; 7+ messages in thread
From: Raslan Darawsheh @ 2017-08-29  7:51 UTC (permalink / raw)
  To: thomas, gaetan.rivet; +Cc: dev

fs_bus_uninit is always returning 0 no matter what was the status
of each sub device bus_uninit value.

Will now return the first sub device fail value in case it fails.

Fixes: a46f8d58 ("net/failsafe: add fail-safe PMD")

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
---
 drivers/net/failsafe/failsafe_eal.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c
index c8f4318..4295347 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 ret = 0, sdev_ret;
 
 	FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {
-		ret = rte_eal_hotplug_remove(sdev->bus->name,
+		sdev_ret = rte_eal_hotplug_remove(sdev->bus->name,
 					     sdev->dev->name);
-		if (ret) {
+		if (sdev_ret) {
 			ERROR("Failed to remove requested device %s",
 			      sdev->dev->name);
+			ret = (ret ? ret : sdev_ret);
 			continue;
 		}
 		sdev->state = DEV_PROBED - 1;
 	}
-	return 0;
+	return ret;
 }
 
 int
-- 
2.7.4

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

end of thread, other threads:[~2017-08-30  9:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29  7:51 [PATCH] net/failsafe: fix failsafe bus uninit return value Raslan Darawsheh
2017-08-29  8:18 ` Gaëtan Rivet
2017-08-29  8:55   ` [PATCH v2] " Raslan Darawsheh
2017-08-29  9:02     ` Gaëtan Rivet
2017-08-29  9:08     ` [PATCH v3] " Raslan Darawsheh
2017-08-29  9:28       ` Gaëtan Rivet
2017-08-30  9:09         ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.