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:
Dan Carpenter 2012-09-25 10:05:33 +03:00 committed by Ohad Ben-Cohen
parent ae768d5fac
commit bec109a430
1 changed files with 1 additions and 1 deletions

View File

@ -161,7 +161,7 @@ rproc_recovery_write(struct file *filp, const char __user *user_buf,
ret = copy_from_user(buf, user_buf, count);
if (ret)
return ret;
return -EFAULT;
/* remove end of line */
if (buf[count - 1] == '\n')