[PATCH v2 1/2] bus/fslmc: fix ignored return value in fslmc_bus_unplug

Md Shofiqul Islam shofiqtest at gmail.com
Sat May 16 13:08:27 CEST 2026


fslmc_bus_unplug() called drv->remove() and discarded the return value,
unconditionally clearing driver references and reporting success even
when the remove callback signalled failure.  As a result, callers had
no way to detect or react to removal errors.

Capture the return value and propagate it to the caller.  Only clear
the driver references and log successful unplug when the callback
returns zero.

Fixes: b5721f271cbf ("bus/fslmc: support DPNI hotplug")
Bugzilla ID: 1914
Cc: hemant.agrawal at nxp.com
Cc: stable at dpdk.org

Signed-off-by: Md Shofiqul Islam <shofiqtest at gmail.com>
---
 drivers/bus/fslmc/fslmc_bus.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index cf881b3eec..57bb61dc35 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -620,7 +620,9 @@ fslmc_bus_unplug(struct rte_device *rte_dev)
 	struct rte_dpaa2_driver *drv = dev->driver;
 
 	if (drv && drv->remove) {
-		drv->remove(dev);
+		int ret = drv->remove(dev);
+		if (ret != 0)
+			return ret;
 		dev->driver = NULL;
 		dev->device.driver = NULL;
 		DPAA2_BUS_INFO("%s Un-Plugged",  dev->device.name);
-- 
2.51.1



More information about the stable mailing list