aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2010-06-06 21:03:04 +0200
committerGreg Kroah-Hartman <[email protected]>2010-06-30 08:18:14 -0700
commit25477f2398f39a35f110e02f6c7d8dd1023c47c1 (patch)
treead312a0b0e687624d72cc035ae09c265fa8c4072
parentf2102d31de1f0ddb9ced62d65d2ed89a5149ea39 (diff)
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 <[email protected]> Signed-off-by: Sven Eckelmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/staging/batman-adv/device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/batman-adv/device.c b/drivers/staging/batman-adv/device.c
index 7eb6559e0315..32204b5572d0 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);
}