The following commit has been merged in the master branch: commit 25477f2398f39a35f110e02f6c7d8dd1023c47c1 Author: Dan Carpenter error27@gmail.com Date: Sun Jun 6 21:03:04 2010 +0200
Staging: batman-adv: return -EFAULT on copy_to_user errors
copy_to_user() returns the number of bites remaining but we want to return a negative error code here.
Signed-off-by: Dan Carpenter error27@gmail.com Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de Signed-off-by: Greg Kroah-Hartman gregkh@suse.de
diff --git a/drivers/staging/batman-adv/device.c b/drivers/staging/batman-adv/device.c index 7eb6559..32204b5 100644 --- a/drivers/staging/batman-adv/device.c +++ b/drivers/staging/batman-adv/device.c @@ -196,7 +196,7 @@ ssize_t bat_device_read(struct file *file, char __user *buf, size_t count, kfree(device_packet);
if (error) - return error; + return -EFAULT;
return sizeof(struct icmp_packet); }