b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: return -EFAULT on copy_to_user errors
       [not found] <20100603100437.GS5483@bicker>
@ 2010-06-03 11:33 ` Sven Eckelmann
  2010-06-05 17:47   ` Simon Wunderlich
  0 siblings, 1 reply; 2+ 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] 2+ 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] batman-adv: return -EFAULT on copy_to_user errors Sven Eckelmann
@ 2010-06-05 17:47   ` Simon Wunderlich
  0 siblings, 0 replies; 2+ 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] 2+ messages in thread

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20100603100437.GS5483@bicker>
2010-06-03 11:33 ` [B.A.T.M.A.N.] [PATCH] batman-adv: return -EFAULT on copy_to_user errors Sven Eckelmann
2010-06-05 17:47   ` Simon Wunderlich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).