Skip to content

Commit a9ee2c4

Browse files
Dan Carpenterjenswi-linaro
authored andcommitted
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>
1 parent b14bb2e commit a9ee2c4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/tee/qcomtee/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ static int qcomtee_prepare_msg(struct qcomtee_object_invoke_ctx *oic,
424424
if (!(u[i].flags & QCOMTEE_ARG_FLAGS_UADDR))
425425
memcpy(msgptr, u[i].b.addr, u[i].b.size);
426426
else if (copy_from_user(msgptr, u[i].b.uaddr, u[i].b.size))
427-
return -EINVAL;
427+
return -EFAULT;
428428

429429
offset += qcomtee_msg_offset_align(u[i].b.size);
430430
ib++;

0 commit comments

Comments
 (0)