Skip to content

Commit 93dcd6f

Browse files
krzkmehmetb0
authored andcommitted
firmware: qcom: scm: smc: Handle missing SCM device
BugLink: https://bugs.launchpad.net/bugs/2104873 [ Upstream commit 94f48ec ] Commit ca61d68 ("firmware: qcom: scm: fix a NULL-pointer dereference") makes it explicit that qcom_scm_get_tzmem_pool() can return NULL, therefore its users should handle this. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/r/20241209-qcom-scm-missing-barriers-and-all-sort-of-srap-v2-5-9061013c8d92@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Noah Wager <noah.wager@canonical.com>
1 parent 5cc1816 commit 93dcd6f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/firmware/qcom/qcom_scm-smc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ int __scm_smc_call(struct device *dev, const struct qcom_scm_desc *desc,
173173
smc.args[i + SCM_SMC_FIRST_REG_IDX] = desc->args[i];
174174

175175
if (unlikely(arglen > SCM_SMC_N_REG_ARGS)) {
176+
if (!mempool)
177+
return -EINVAL;
178+
176179
args_virt = qcom_tzmem_alloc(mempool,
177180
SCM_SMC_N_EXT_ARGS * sizeof(u64),
178181
flag);

0 commit comments

Comments
 (0)