From cf2d3fc9786ba005f9bde50a4e72a1d0b70472ff Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sun, 6 Jun 2010 21:03:04 +0200 Subject: [PATCH] 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 --- drivers/staging/batman-adv/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- GitLab