[PATCH 08/10] remoteproc: qcom: Skip unregistering uninitialised SSR subdevice

From: Lee Jones

Date: Mon Nov 23 2026 - 12:22:57 EST


If qcom_ssr_get_subsys() fails in qcom_add_ssr_subdev(), the function
logs an error and returns early without calling rproc_add_subdev(),
leaving ssr->info NULL and ssr->subdev.node uninitialised. When driver
probe unwinds or the device is later removed, qcom_remove_ssr_subdev()
unconditionally calls rproc_remove_subdev(), dereferencing a NULL list
pointer in list_del().

Guard qcom_remove_ssr_subdev() on ssr->info being non-NULL, matching the
GLINK and SMD subdevice teardown helpers.

Fixes: 5abfe5cf0b83 ("remoteproc: qcom: Add per subsystem SSR notification")
Closes: https://sashiko.dev/#/bug/linux-5594c348-0c41-4482-b001-481878256d30
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
drivers/remoteproc/qcom_common.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
index c53190f0c537..6fd92c33392b 100644
--- a/drivers/remoteproc/qcom_common.c
+++ b/drivers/remoteproc/qcom_common.c
@@ -537,6 +537,9 @@ EXPORT_SYMBOL_GPL(qcom_add_ssr_subdev);
*/
void qcom_remove_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr)
{
+ if (!ssr->info)
+ return;
+
rproc_remove_subdev(rproc, &ssr->subdev);
ssr->info = NULL;
}
--
2.56.1.750.gf70dc682cf-goog