From: Lee Jones <lee@kernel.org>
To: lee@kernel.org, Bjorn Andersson <andersson@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Rishabh Bhatnagar <rishabhb@codeaurora.org>,
Siddharth Gupta <sidgup@codeaurora.org>,
Alex Elder <elder@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: [PATCH 08/10] remoteproc: qcom: Skip unregistering uninitialised SSR subdevice
Date: Mon, 23 Nov 2026 17:20:52 +0000 [thread overview]
Message-ID: <20261123172140.3547896-9-lee@kernel.org> (raw)
In-Reply-To: <20261123172140.3547896-1-lee@kernel.org>
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@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
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
next prev parent reply other threads:[~2026-11-23 17:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 17:20 [PATCH 00/10] remoteproc: Assorted bug fixes across remoteproc core and drivers Lee Jones
2026-11-23 17:20 ` [PATCH 01/10] remoteproc: core: Fix integer overflow in rproc_check_carveout_da() Lee Jones
2026-11-23 17:20 ` [PATCH 02/10] remoteproc: k3: Fix integer overflow in k3_rproc_da_to_va() Lee Jones
2026-11-23 17:20 ` [PATCH 03/10] remoteproc: omap: Fix integer overflow in omap_rproc_da_to_va() Lee Jones
2026-11-23 17:20 ` [PATCH 04/10] remoteproc: elf_loader: Fix overflow in rproc_elf_load_segments() Lee Jones
2026-11-23 17:20 ` [PATCH 05/10] remoteproc: imx_rproc: Avoid stale mailbox pointers on request failure Lee Jones
2026-11-23 17:20 ` [PATCH 06/10] remoteproc: imx_rproc: Register SCU cleanup after resource acquisition Lee Jones
2026-11-23 17:20 ` [PATCH 07/10] remoteproc: qcom: Clear glink->node on allocation failure Lee Jones
2026-11-23 17:20 ` Lee Jones [this message]
2026-11-23 17:20 ` [PATCH 09/10] remoteproc: imx_dsp_rproc: Fix pointer stride in imx_dsp_rproc_memset() Lee Jones
2026-11-23 17:20 ` [PATCH 10/10] remoteproc: imx_dsp_rproc: Fix off-by-one bitmask for trailing bytes Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261123172140.3547896-9-lee@kernel.org \
--to=lee@kernel.org \
--cc=andersson@kernel.org \
--cc=elder@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=rishabhb@codeaurora.org \
--cc=sidgup@codeaurora.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®