[PATCH 3/3] Fixes: 15847537b623 ("firmware: stratix10-rsu: Migrate RSU driver to use stratix10 asynchronous framework.")
From: tze . yee . ng
Date: Thu May 14 2026 - 03:32:35 EST
From: Tze Yee Ng <tze.yee.ng@xxxxxxxxxx>
After stratix10_svc_add_async_client() succeeds, probe error paths and
remove() must call stratix10_svc_remove_async_client() before
stratix10_svc_free_channel(). Otherwise async state is left allocated
while the channel is released.
Signed-off-by: Tze Yee Ng <tze.yee.ng@xxxxxxxxxx>
---
drivers/firmware/stratix10-rsu.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/stratix10-rsu.c b/drivers/firmware/stratix10-rsu.c
index 6c5f952f48d8..a0f679f73460 100644
--- a/drivers/firmware/stratix10-rsu.c
+++ b/drivers/firmware/stratix10-rsu.c
@@ -958,21 +958,27 @@ static int stratix10_rsu_probe(struct platform_device *pdev)
0, rsu_dcmf_version_callback);
if (ret) {
dev_err(dev, "Error, getting DCMF version %i\n", ret);
+ stratix10_svc_remove_async_client(priv->chan);
stratix10_svc_free_channel(priv->chan);
+ return ret;
}
ret = rsu_send_msg(priv, COMMAND_RSU_DCMF_STATUS,
0, rsu_dcmf_status_callback);
if (ret) {
dev_err(dev, "Error, getting DCMF status %i\n", ret);
+ stratix10_svc_remove_async_client(priv->chan);
stratix10_svc_free_channel(priv->chan);
+ return ret;
}
ret = rsu_send_msg(priv, COMMAND_RSU_MAX_RETRY, 0,
rsu_max_retry_callback);
if (ret) {
dev_err(dev, "Error, getting RSU max retry %i\n", ret);
+ stratix10_svc_remove_async_client(priv->chan);
stratix10_svc_free_channel(priv->chan);
+ return ret;
}
/* get QSPI device info from firmware */
@@ -989,16 +995,19 @@ static int stratix10_rsu_probe(struct platform_device *pdev)
rsu_async_get_spt_table_callback);
if (ret) {
dev_err(dev, "Error, getting SPT table %i\n", ret);
+ stratix10_svc_remove_async_client(priv->chan);
stratix10_svc_free_channel(priv->chan);
+ return ret;
}
- return ret;
+ return 0;
}
static void stratix10_rsu_remove(struct platform_device *pdev)
{
struct stratix10_rsu_priv *priv = platform_get_drvdata(pdev);
+ stratix10_svc_remove_async_client(priv->chan);
stratix10_svc_free_channel(priv->chan);
}
--
2.43.7