Skip to content

Commit ff34f3c

Browse files
committed
firmware: qcom: scm: Ensure 'a0' status code is treated as signed
The 'a0' member of 'struct arm_smccc_res' is declared as 'unsigned long', however the Qualcomm SCM firmware interface driver expects to receive negative error codes via this field, so ensure that it's cast to 'long' before comparing to see if it is less than 0. Cc: <stable@vger.kernel.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Will Deacon <will@kernel.org>
1 parent ee9bdfe commit ff34f3c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/firmware/qcom_scm-64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static int qcom_scm_call(struct device *dev, u32 svc_id, u32 cmd_id,
150150
kfree(args_virt);
151151
}
152152

153-
if (res->a0 < 0)
153+
if ((long)res->a0 < 0)
154154
return qcom_scm_remap_error(res->a0);
155155

156156
return 0;

0 commit comments

Comments
 (0)