summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-09-25 09:05:33 +0200
committerOhad Ben-Cohen <ohad@wizery.com>2012-09-30 11:44:53 +0200
commitbec109a430e8c67bae1743f7e71898283234a77f (patch)
tree181eb8689c59f3fa6a63f28468591fceb93a68c9
parentremoteproc: snprintf() can return more than was printed (diff)
downloadlinux-bec109a430e8c67bae1743f7e71898283234a77f.tar.xz
linux-bec109a430e8c67bae1743f7e71898283234a77f.zip
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>
-rw-r--r--drivers/remoteproc/remoteproc_debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c
index ea90a5643db3..157a57309601 100644
--- a/drivers/remoteproc/remoteproc_debugfs.c
+++ b/drivers/remoteproc/remoteproc_debugfs.c
@@ -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')