All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven.eckelmann@gmx.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] Staging: batman-adv: return -EFAULT on copy_to_user errors
Date: Thu, 03 Jun 2010 10:22:47 +0000	[thread overview]
Message-ID: <201006031222.59904.sven.eckelmann@gmx.de> (raw)
In-Reply-To: <20100603100437.GS5483@bicker>

[-- 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 --]

  reply	other threads:[~2010-06-03 10:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2010-06-03 11:33 ` [B.A.T.M.A.N.] [PATCH] " Sven Eckelmann
2010-06-05 17:47   ` Simon Wunderlich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201006031222.59904.sven.eckelmann@gmx.de \
    --to=sven.eckelmann@gmx.de \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.