If copy_from_user() fails, the correct error code is -EFAULT, not -EINVAL.
Signed-off-by: Dan Carpenter dan.carpenter@linaro.org --- drivers/tee/qcomtee/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tee/qcomtee/core.c b/drivers/tee/qcomtee/core.c index 783acc59cfa9..b6715ada7700 100644 --- a/drivers/tee/qcomtee/core.c +++ b/drivers/tee/qcomtee/core.c @@ -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++;
On Thu, Sep 18, 2025 at 12:50:41PM +0300, Dan Carpenter wrote:
If copy_from_user() fails, the correct error code is -EFAULT, not -EINVAL.
Signed-off-by: Dan Carpenter dan.carpenter@linaro.org
drivers/tee/qcomtee/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Sumit Garg sumit.garg@oss.qualcomm.com
-Sumit
diff --git a/drivers/tee/qcomtee/core.c b/drivers/tee/qcomtee/core.c index 783acc59cfa9..b6715ada7700 100644 --- a/drivers/tee/qcomtee/core.c +++ b/drivers/tee/qcomtee/core.c @@ -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++; -- 2.51.0
On Fri, Sep 19, 2025 at 7:22 AM Sumit Garg sumit.garg@kernel.org wrote:
On Thu, Sep 18, 2025 at 12:50:41PM +0300, Dan Carpenter wrote:
If copy_from_user() fails, the correct error code is -EFAULT, not -EINVAL.
Signed-off-by: Dan Carpenter dan.carpenter@linaro.org
drivers/tee/qcomtee/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Sumit Garg sumit.garg@oss.qualcomm.com
Applied.
/Jens
-Sumit
diff --git a/drivers/tee/qcomtee/core.c b/drivers/tee/qcomtee/core.c index 783acc59cfa9..b6715ada7700 100644 --- a/drivers/tee/qcomtee/core.c +++ b/drivers/tee/qcomtee/core.c @@ -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++;-- 2.51.0
op-tee@lists.trustedfirmware.org