mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
tee: qcom: return -EFAULT instead of -EINVAL if copy_from_user() fails
If copy_from_user() fails, the correct error code is -EFAULT, not -EINVAL. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
This commit is contained in:
parent
b14bb2e782
commit
a9ee2c461e
1 changed files with 1 additions and 1 deletions
|
|
@ -424,7 +424,7 @@ static int qcomtee_prepare_msg(struct qcomtee_object_invoke_ctx *oic,
|
|||
if (!(u[i].flags & QCOMTEE_ARG_FLAGS_UADDR))
|
||||
memcpy(msgptr, u[i].b.addr, u[i].b.size);
|
||||
else if (copy_from_user(msgptr, u[i].b.uaddr, u[i].b.size))
|
||||
return -EINVAL;
|
||||
return -EFAULT;
|
||||
|
||||
offset += qcomtee_msg_offset_align(u[i].b.size);
|
||||
ib++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue