From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch 3/3] remoteproc: return -EFAULT on copy_from_user failure
Date: Tue, 25 Sep 2012 07:05:33 +0000 [thread overview]
Message-ID: <20120925070533.GD23009@elgon.mountain> (raw)
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')
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch 3/3] remoteproc: return -EFAULT on copy_from_user failure
Date: Tue, 25 Sep 2012 10:05:33 +0300 [thread overview]
Message-ID: <20120925070533.GD23009@elgon.mountain> (raw)
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')
next reply other threads:[~2012-09-25 7:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-25 7:05 Dan Carpenter [this message]
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
2012-09-30 9:45 ` Ohad Ben-Cohen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120925070533.GD23009@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ohad@wizery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.