* [patch 3/3] remoteproc: return -EFAULT on copy_from_user failure
@ 2012-09-25 7:05 Dan Carpenter
2012-09-30 9:45 ` Ohad Ben-Cohen
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-09-25 7:05 UTC (permalink / raw)
To: Ohad Ben-Cohen; +Cc: linux-kernel, kernel-janitors
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>
diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c
index ea90a56..157a573 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')
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-30 9:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-25 7:05 [patch 3/3] remoteproc: return -EFAULT on copy_from_user failure Dan Carpenter
2012-09-30 9:45 ` Ohad Ben-Cohen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox