remoteproc: return -EFAULT on copy_from_user failure
copy_from_user() returns the number of bytes remaining to be copied, but we want to return an error code here. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
This commit is contained in:
Родитель
ae768d5fac
Коммит
bec109a430
|
@ -161,7 +161,7 @@ rproc_recovery_write(struct file *filp, const char __user *user_buf,
|
||||||
|
|
||||||
ret = copy_from_user(buf, user_buf, count);
|
ret = copy_from_user(buf, user_buf, count);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return -EFAULT;
|
||||||
|
|
||||||
/* remove end of line */
|
/* remove end of line */
|
||||||
if (buf[count - 1] == '\n')
|
if (buf[count - 1] == '\n')
|
||||||
|
|
Загрузка…
Ссылка в новой задаче