From: Dan Carpenter Date: Sun, 6 Jun 2010 19:03:04 +0000 (+0200) Subject: Staging: batman-adv: return -EFAULT on copy_to_user errors X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=25477f2398f39a35f110e02f6c7d8dd1023c47c1;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 Signed-off-by: Sven Eckelmann Signed-off-by: Greg Kroah-Hartman --- 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); }