* [patch] mei: copy_from_user() doesn't return an error code
@ 2012-10-26 7:00 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-10-26 7:00 UTC (permalink / raw)
To: Tomas Winkler; +Cc: linux-kernel, kernel-janitors
copy_from_user() returns the number of bytes remaining but we should be
returning -EFAULT here.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Only needed in linux-next.
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index ed4943f..ce1014e 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -607,8 +607,8 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
dev_dbg(&dev->pdev->dev, "cb request size = %zd\n", length);
- rets = copy_from_user(write_cb->request_buffer.data, ubuf, length);
- if (rets)
+ rets = -EFAULT;
+ if (copy_from_user(write_cb->request_buffer.data, ubuf, length))
goto unlock_dev;
cl->sm_state = 0;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-10-26 7:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-26 7:00 [patch] mei: copy_from_user() doesn't return an error code Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox