Skip to content

Commit

Permalink
remoteproc: return -EFAULT on copy_from_user failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Ohad Ben-Cohen committed Sep 30, 2012
1 parent ae768d5 commit bec109a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/remoteproc/remoteproc_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit bec109a

Please sign in to comment.