[PATCH] EDAC/versalnet: release remoteproc reference in remove
From: Guangshuo Li
Date: Wed Jun 03 2026 - 09:48:53 EST
mc_probe() gets a remoteproc reference with rproc_get_by_phandle() and
stores it in priv->mcdi->r5_rproc after the remote processor has been
booted.
The probe error paths release that reference with rproc_put(), but the
remove path only shuts the remote processor down. This leaks the
remoteproc device and module references on every successful probe/remove
cycle.
Call rproc_put() in mc_remove() after rproc_shutdown().
Fixes: d5fe2fec6c40d ("EDAC: Add a driver for the AMD Versal NET DDR controller")
Signed-off-by: Guangshuo Li <lgs201920130244@xxxxxxxxx>
---
drivers/edac/versalnet_edac.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/edac/versalnet_edac.c b/drivers/edac/versalnet_edac.c
index 2cbc13d9bd00..82b6426d9a79 100644
--- a/drivers/edac/versalnet_edac.c
+++ b/drivers/edac/versalnet_edac.c
@@ -937,6 +937,7 @@ static void mc_remove(struct platform_device *pdev)
unregister_rpmsg_driver(&amd_rpmsg_driver);
remove_versalnet(priv);
rproc_shutdown(priv->mcdi->r5_rproc);
+ rproc_put(priv->mcdi->r5_rproc);
cdx_mcdi_finish(priv->mcdi);
}
--
2.43.0