[PATCH] remoteproc: qcom_wcnss: Clean up subdevices on probe failure
From: Anup Vishwakarma
Date: Thu Nov 05 2026 - 07:38:21 EST
wcnss_probe() registers the SMD and sysmon subdevices before the iris
probe and rproc_add(), but the error paths after them only release the
power domains. A failure there, such as a deferred probe of the iris
clock or regulators, leaves the SMD subdevice registered with its
smd-edge node reference held, and leaves the sysmon instance on the
global sysmon list.
Unwind in reverse order of registration. The sysmon failure path skips
qcom_remove_sysmon_subdev(), as wcnss->sysmon is an error pointer there.
Fixes: 5a856bc63ce9 ("remoteproc: wcnss: Bond SMD edge to remoteproc")
Fixes: 1fb82ee806d1 ("remoteproc: qcom: Introduce sysmon")
Signed-off-by: Anup Vishwakarma <anup.vishwakarma@xxxxxxxxxxxxxxxx>
---
drivers/remoteproc/qcom_wcnss.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
index c856a92af43c..f4847fb8f13b 100644
--- a/drivers/remoteproc/qcom_wcnss.c
+++ b/drivers/remoteproc/qcom_wcnss.c
@@ -653,13 +653,13 @@ static int wcnss_probe(struct platform_device *pdev)
wcnss->sysmon = qcom_add_sysmon_subdev(rproc, "wcnss", WCNSS_SSCTL_ID);
if (IS_ERR(wcnss->sysmon)) {
ret = PTR_ERR(wcnss->sysmon);
- goto detach_pds;
+ goto remove_smd_subdev;
}
wcnss->iris = qcom_iris_probe(&pdev->dev, &wcnss->use_48mhz_xo);
if (IS_ERR(wcnss->iris)) {
ret = PTR_ERR(wcnss->iris);
- goto detach_pds;
+ goto remove_sysmon_subdev;
}
ret = rproc_add(rproc);
@@ -670,6 +670,10 @@ static int wcnss_probe(struct platform_device *pdev)
remove_iris:
qcom_iris_remove(wcnss->iris);
+remove_sysmon_subdev:
+ qcom_remove_sysmon_subdev(wcnss->sysmon);
+remove_smd_subdev:
+ qcom_remove_smd_subdev(rproc, &wcnss->smd_subdev);
detach_pds:
wcnss_release_pds(wcnss);
---
base-commit: 8b7179210b22f8e48a82c5ceacb9d56a9c4cfec4
change-id: 20261105-b4-wcnss_unwind_send-dfd3abeeb82d
Best regards,
--
Anup Vishwakarma <anup.vishwakarma@xxxxxxxxxxxxxxxx>