remoteproc: qcom: Clear the GLINK node after name allocation failure
PATCH 1/1 remoteproc: qcom: Clear the GLINK node after name allocation failure
If kstrdup_const() fails, qcom_add_glink_subdev() puts the acquired node reference and returns without adding the subdevice. However, glink->node remains set, so qcom_remove_glink_subdev() later treats the subdevice as registered. It attempts to remove an uninitialized list entry and can also drop the node reference a second time.
Clear glink->node after the error-path put so that the existing guard in qcom_remove_glink_subdev() skips a subdevice that was never added.
---
AI assistance was used for analysis and patch preparation.
Based on next-20261104 (8b7179210b22).
Compile-tested: arm64, GCC 14.2.0, W=1, drivers/remoteproc/qcom_common.o; baseline and patched objects built with no warnings.
Static source review; no hardware, boot, or KASAN test was performed.
drivers/remoteproc/qcom_common.c | 1 + 1 file changed, 1 insertion(+)
drivers/remoteproc/qcom_common.c +1 -0
@@ -255,6 +255,7 @@ void qcom_add_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink, glink->ssr_name =kstrdup_const (ssr_name,GFP_KERNEL );if (!glink->ssr_name) {of_node_put (glink->node); + glink->node =NULL ;return ; }
base-commit: 8b7179210b22f8e48a82c5ceacb9d56a9c4cfec4