Commit a9ee2c46 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jens Wiklander
Browse files

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: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarSumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
parent b14bb2e7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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++;