When a sub-device is removed, fs_dev_remove() detaches the underlying
bus device, and that remove path already releases the ethdev port of
the sub-device. The fail-safe code then called
rte_eth_dev_release_port() a second time on the same port, resulting in
a double release of the port during hot-unplug.

Drop the redundant rte_eth_dev_release_port() call and let the bus
remove path own the release of the port.

Fixes: fac0ae546e5f ("net/failsafe: free port by dedicated function")
Cc: [email protected]
Signed-off-by: Sandeep Penigalapati <[email protected]>
---
 drivers/net/failsafe/failsafe_ether.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/failsafe/failsafe_ether.c 
b/drivers/net/failsafe/failsafe_ether.c
index f0fd662c7b..4eaa337f55 100644
--- a/drivers/net/failsafe/failsafe_ether.c
+++ b/drivers/net/failsafe/failsafe_ether.c
@@ -301,8 +301,6 @@ fs_dev_remove(struct sub_device *sdev)
                if (ret < 0) {
                        ERROR("Bus detach failed for sub_device %u",
                              SUB_ID(sdev));
-               } else {
-                       rte_eth_dev_release_port(ETH(sdev));
                }
                sdev->state = DEV_PARSED;
                /* fallthrough */
-- 
2.34.1

Reply via email to