public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [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

* Re: [patch 3/3] remoteproc: return -EFAULT on copy_from_user failure
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Ohad Ben-Cohen @ 2012-09-30  9:45 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-kernel, kernel-janitors

On Tue, Sep 25, 2012 at 9:05 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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>

Applied, thanks.

^ permalink raw reply	[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