Skip to contentSkip to conversation

FAILED: patch "[PATCH] misc: fastrpc: check qcom_scm_assign_mem() return in" failed to apply to 6.12-stable tree

PATCH New [email protected] 2 participants 2 messages Apr 8

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 6a502776f4a4f80fb839b22f12aeaf0267fca344
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026040853-keg-enchanted-fd3d@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 6a502776f4a4f80fb839b22f12aeaf0267fca344 Mon Sep 17 00:00:00 2001
From: Xingjing Deng <[email protected]>
Date: Sat, 31 Jan 2026 14:55:39 +0800
Subject: [PATCH] misc: fastrpc: check qcom_scm_assign_mem() return in
rpmsg_probe

In the SDSP probe path, qcom_scm_assign_mem() is used to assign the reserved memory to the configured VMIDs, but its return value was not checked.

Fail the probe if the SCM call fails to avoid continuing with an unexpected/incorrect memory permission configuration.

This issue was found by an in-house analysis workflow that extracts AST-based information and runs static checks, with LLM assistance for triage, and was confirmed by manual code review.
No hardware testing was performed.

Fixes c3c0363bc72d4 ("misc: fastrpc: support complete DMA pool access to the DSP")
Cc [email protected] # 6.11-rc1
drivers/misc/fastrpc.c +3 -1
index 19cfc487df7c..1080f9acf70a 100644
@@ -2390,8 +2390,10 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
 		if (!err) {
 			src_perms = BIT(QCOM_SCM_VMID_HLOS);
 
-			qcom_scm_assign_mem(res.start, resource_size(&res), &src_perms,
+			err = qcom_scm_assign_mem(res.start, resource_size(&res), &src_perms,
 				    data->vmperms, data->vmcount);
+			if (err)
+				goto err_free_data;
 		}
 
 	}
maintainer
#1 lore raw

PATCH 1/1 misc: fastrpc: check qcom_scm_assign_mem() return in rpmsg_probe

From: Xingjing Deng <[email protected]>

[ Upstream commit 6a502776f4a4f80fb839b22f12aeaf0267fca344 ]

In the SDSP probe path, qcom_scm_assign_mem() is used to assign the reserved memory to the configured VMIDs, but its return value was not checked.

Fail the probe if the SCM call fails to avoid continuing with an unexpected/incorrect memory permission configuration.

This issue was found by an in-house analysis workflow that extracts AST-based information and runs static checks, with LLM assistance for triage, and was confirmed by manual code review.
No hardware testing was performed.

Fixes c3c0363bc72d4 ("misc: fastrpc: support complete DMA pool access to the DSP")
Cc [email protected] # 6.11-rc1
[ adapted qcom_scm_assign_mem() error check to use fdev_error label and rmem-based memory API ]
---
 drivers/misc/fastrpc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/misc/fastrpc.c +3 -1
index d6c55c338b062..d3d4d50fb0e54 100644
@@ -2345,8 +2345,10 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
 
 		src_perms = BIT(QCOM_SCM_VMID_HLOS);
 
-		qcom_scm_assign_mem(rmem->base, rmem->size, &src_perms,
+		err = qcom_scm_assign_mem(rmem->base, rmem->size, &src_perms,
 				    data->vmperms, data->vmcount);
+		if (err)
+			goto fdev_error;
 
 	}
 
Signature · 1 line
2.53.0