* [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
* Re: [patch] Staging: batman-adv: return -EFAULT on copy_to_user errors
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
1 sibling, 0 replies; 4+ messages in thread
From: Sven Eckelmann @ 2010-06-03 10:22 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: Text/Plain, Size: 798 bytes --]
Dan Carpenter wrote:
> 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);
> }
Thanks for your patch, but this collides with a patch currently waiting in
GregKH's queue. I will port that patch on top of that.
Best regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [B.A.T.M.A.N.] [PATCH] batman-adv: return -EFAULT on copy_to_user errors
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 ` Sven Eckelmann
2010-06-05 17:47 ` Simon Wunderlich
1 sibling, 1 reply; 4+ messages in thread
From: Sven Eckelmann @ 2010-06-03 11:33 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Dan Carpenter
From: Dan Carpenter <error27@gmail.com>
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>
[sven.eckelmann@gmx.de: Move change from device.c to icmp_socket.c]
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
This patch is already applied in maint and must be applied in master.
batman-adv-kernelland/icmp_socket.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/batman-adv-kernelland/icmp_socket.c b/batman-adv-kernelland/icmp_socket.c
index bad87fd..08cca22 100644
--- a/batman-adv-kernelland/icmp_socket.c
+++ b/batman-adv-kernelland/icmp_socket.c
@@ -148,7 +148,7 @@ static ssize_t bat_socket_read(struct file *file, char __user *buf,
kfree(socket_packet);
if (error)
- return error;
+ return -EFAULT;
return packet_len;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: return -EFAULT on copy_to_user errors
2010-06-03 11:33 ` [B.A.T.M.A.N.] [PATCH] " Sven Eckelmann
@ 2010-06-05 17:47 ` Simon Wunderlich
0 siblings, 0 replies; 4+ messages in thread
From: Simon Wunderlich @ 2010-06-05 17:47 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
[-- Attachment #1: Type: text/plain, Size: 1086 bytes --]
Thank you, applied in svn r1689.
On Thu, Jun 03, 2010 at 01:33:27PM +0200, Sven Eckelmann wrote:
> From: Dan Carpenter <error27@gmail.com>
>
> 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>
> [sven.eckelmann@gmx.de: Move change from device.c to icmp_socket.c]
> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
> ---
> This patch is already applied in maint and must be applied in master.
>
> batman-adv-kernelland/icmp_socket.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/batman-adv-kernelland/icmp_socket.c b/batman-adv-kernelland/icmp_socket.c
> index bad87fd..08cca22 100644
> --- a/batman-adv-kernelland/icmp_socket.c
> +++ b/batman-adv-kernelland/icmp_socket.c
> @@ -148,7 +148,7 @@ static ssize_t bat_socket_read(struct file *file, char __user *buf,
> kfree(socket_packet);
>
> if (error)
> - return error;
> + return -EFAULT;
>
> return packet_len;
> }
> --
> 1.7.1
>
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [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.