diff options
author | Dan Carpenter <error27@gmail.com> | 2010-06-06 21:03:04 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-30 08:18:14 -0700 |
commit | 25477f2398f39a35f110e02f6c7d8dd1023c47c1 (patch) | |
tree | ad312a0b0e687624d72cc035ae09c265fa8c4072 | |
parent | f2102d31de1f0ddb9ced62d65d2ed89a5149ea39 (diff) | |
download | blackbird-op-linux-25477f2398f39a35f110e02f6c7d8dd1023c47c1.tar.gz blackbird-op-linux-25477f2398f39a35f110e02f6c7d8dd1023c47c1.zip |
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>
-rw-r--r-- | drivers/staging/batman-adv/device.c | 2 |
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); } |