[patch] mei: copy_from_user() doesn't return an error code

From: Dan Carpenter
Date: Fri Oct 26 2012 - 03:00:39 EST


copy_from_user() returns the number of bytes remaining but we should be
returning -EFAULT here.

Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/