diff options
author | Will Deacon <will@kernel.org> | 2019-11-04 18:58:15 +0300 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2019-11-04 20:48:08 +0300 |
commit | ff34f3cce278a0982a7b66b1afaed6295141b1fc (patch) | |
tree | 87ff18a42db88a9810071264b0ed5d17a96f6132 /drivers/firmware | |
parent | ee9bdfedd3dc1b3303390663189defa4d6b9e458 (diff) | |
download | linux-ff34f3cce278a0982a7b66b1afaed6295141b1fc.tar.xz |
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>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/qcom_scm-64.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/qcom_scm-64.c b/drivers/firmware/qcom_scm-64.c index 91d5ad7cf58b..25e0f60c759a 100644 --- a/drivers/firmware/qcom_scm-64.c +++ b/drivers/firmware/qcom_scm-64.c @@ -150,7 +150,7 @@ static int qcom_scm_call(struct device *dev, u32 svc_id, u32 cmd_id, kfree(args_virt); } - if (res->a0 < 0) + if ((long)res->a0 < 0) return qcom_scm_remap_error(res->a0); return 0; |