lkml.org 
[lkml]   [2012]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 3/3] 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>

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')

\
 
 \ /
  Last update: 2012-09-25 09:41    [W:0.032 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site