summaryrefslogtreecommitdiffstats
path: root/drivers/staging/batman-adv
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-06-06 21:03:04 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-06-21 15:31:52 -0700
commitcf2d3fc9786ba005f9bde50a4e72a1d0b70472ff (patch)
tree661ac236928e9d2823d1bf30967ea321e020b008 /drivers/staging/batman-adv
parente6dc269b402d9fa1562276345931943683e16ebd (diff)
downloadtalos-op-linux-cf2d3fc9786ba005f9bde50a4e72a1d0b70472ff.tar.gz
talos-op-linux-cf2d3fc9786ba005f9bde50a4e72a1d0b70472ff.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>
Diffstat (limited to 'drivers/staging/batman-adv')
-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);
}
OpenPOWER on IntegriCloud