All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] Staging: batman-adv: return -EFAULT on copy_to_user errors
@ 2010-06-03 10:04 Dan Carpenter
  2010-06-03 10:22 ` Sven Eckelmann
  2010-06-03 11:33 ` [B.A.T.M.A.N.] [PATCH] " Sven Eckelmann
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2010-06-03 10:04 UTC (permalink / raw)
  To: kernel-janitors

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>

diff --git a/drivers/staging/batman-adv/device.c b/drivers/staging/batman-adv/device.c
index ad82ec4..c7f3978 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);
 }

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-06-05 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-03 10:04 [patch] Staging: batman-adv: return -EFAULT on copy_to_user errors Dan Carpenter
2010-06-03 10:22 ` Sven Eckelmann
2010-06-03 11:33 ` [B.A.T.M.A.N.] [PATCH] " Sven Eckelmann
2010-06-05 17:47   ` Simon Wunderlich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.