summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2019-11-04 18:58:15 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-17 22:35:42 +0300
commit10eb175f8e0504edef86000cf8920a57de05d30d (patch)
tree93fdf6eeede00684e9b98e0919d6ee051c29a228 /drivers
parent8e7a865366105b978eef4108f49a12100eea4299 (diff)
downloadlinux-10eb175f8e0504edef86000cf8920a57de05d30d.tar.xz
firmware: qcom: scm: Ensure 'a0' status code is treated as signed
commit ff34f3cce278a0982a7b66b1afaed6295141b1fc upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firmware/qcom_scm-64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/qcom_scm-64.c b/drivers/firmware/qcom_scm-64.c
index 688525dd4aee..367e727a8f93 100644
--- a/drivers/firmware/qcom_scm-64.c
+++ b/drivers/firmware/qcom_scm-64.c
@@ -158,7 +158,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;