All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] dma/coh901318: use simple_read_from_buffer
Date: Fri, 22 Oct 2010 21:16:31 +0200	[thread overview]
Message-ID: <201010222116.32069.arnd@arndb.de> (raw)
In-Reply-To: <20101022203039.7b353056@absol.kitzblitz>

On Friday 22 October 2010 20:30:39 Nicolas Kaiser wrote:
> * Arnd Bergmann <arnd@arndb.de>:
> > On Friday 22 October 2010 19:29:53 Nicolas Kaiser wrote:
> > > If copy_to_user fails, the assigned error code instantly gets
> > > overwritten, and the failure apparently ignored. Moreover,
> > > shouldn't the error code be -EFAULT instead of -EINVAL?
> > 
> > Looks good, but it would be even better to just use
> > simple_read_from_buffer in this function, which takes care of
> > a lot the other complexities as well.
> 
> Like this? (Sorry, untested.)
> 
> Signed-off-by: Nicolas Kaiser <nikai@nikai.net>

Yes, exactly. For stable kernels, your smaller fix is probably good
enough though and it's obviously correct.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Nicolas Kaiser <nikai@nikai.net>,
	Per Friden <per.friden@stericsson.com>,
	Linus Walleij <linus.walleij@stericsson.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dma/coh901318: use simple_read_from_buffer
Date: Fri, 22 Oct 2010 21:16:31 +0200	[thread overview]
Message-ID: <201010222116.32069.arnd@arndb.de> (raw)
In-Reply-To: <20101022203039.7b353056@absol.kitzblitz>

On Friday 22 October 2010 20:30:39 Nicolas Kaiser wrote:
> * Arnd Bergmann <arnd@arndb.de>:
> > On Friday 22 October 2010 19:29:53 Nicolas Kaiser wrote:
> > > If copy_to_user fails, the assigned error code instantly gets
> > > overwritten, and the failure apparently ignored. Moreover,
> > > shouldn't the error code be -EFAULT instead of -EINVAL?
> > 
> > Looks good, but it would be even better to just use
> > simple_read_from_buffer in this function, which takes care of
> > a lot the other complexities as well.
> 
> Like this? (Sorry, untested.)
> 
> Signed-off-by: Nicolas Kaiser <nikai@nikai.net>

Yes, exactly. For stable kernels, your smaller fix is probably good
enough though and it's obviously correct.

	Arnd

  reply	other threads:[~2010-10-22 19:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-22 17:29 [PATCH] dma/coh901318: fix copy_to_user error path Nicolas Kaiser
2010-10-22 17:29 ` Nicolas Kaiser
2010-10-22 17:38 ` Arnd Bergmann
2010-10-22 17:38   ` Arnd Bergmann
2010-10-22 18:30   ` [PATCH] dma/coh901318: use simple_read_from_buffer Nicolas Kaiser
2010-10-22 18:30     ` Nicolas Kaiser
2010-10-22 19:16     ` Arnd Bergmann [this message]
2010-10-22 19:16       ` Arnd Bergmann

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=201010222116.32069.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.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.