Skip to content

Commit 6a50277

Browse files
MicroMilogregkh
authored andcommitted
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: c3c0363 ("misc: fastrpc: support complete DMA pool access to the DSP") Cc: stable@vger.kernel.org # 6.11-rc1 Signed-off-by: Xingjing Deng <xjdeng@buaa.edu.cn> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link: https://patch.msgid.link/20260131065539.2124047-1-xjdeng@buaa.edu.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ba2c831 commit 6a50277

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/misc/fastrpc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2390,8 +2390,10 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
23902390
if (!err) {
23912391
src_perms = BIT(QCOM_SCM_VMID_HLOS);
23922392

2393-
qcom_scm_assign_mem(res.start, resource_size(&res), &src_perms,
2393+
err = qcom_scm_assign_mem(res.start, resource_size(&res), &src_perms,
23942394
data->vmperms, data->vmcount);
2395+
if (err)
2396+
goto err_free_data;
23952397
}
23962398

23972399
}

0 commit comments

Comments
 (0)