Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Dan Carpenter and committed by
Jens Wiklander
a9ee2c46 b14bb2e7

+1 -1
+1 -1
drivers/tee/qcomtee/core.c
··· 424 424 if (!(u[i].flags & QCOMTEE_ARG_FLAGS_UADDR)) 425 425 memcpy(msgptr, u[i].b.addr, u[i].b.size); 426 426 else if (copy_from_user(msgptr, u[i].b.uaddr, u[i].b.size)) 427 - return -EINVAL; 427 + return -EFAULT; 428 428 429 429 offset += qcomtee_msg_offset_align(u[i].b.size); 430 430 ib++;