From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: David Brownell <david-b@pacbell.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: [patch] gpiolib: fix oops in gpio_get_value_cansleep()
Date: Thu, 16 Oct 2008 20:43:30 +0400 [thread overview]
Message-ID: <20081016164330.GB27938@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <200810160845.22281.david-b@pacbell.net>
On Thu, Oct 16, 2008 at 08:45:22AM -0700, David Brownell wrote:
> From: David Brownell <dbrownell@users.sourceforge.net>
[...]
> So the problem is that gpio_get_value_cansleep() isn't making
> the same sanity check that gpio_get_value() does: making sure
> this GPIO isn't one of the atypical "no input logic" cases.
>
> Reported-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
> ---
> drivers/gpio/gpiolib.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -1056,7 +1056,7 @@ int gpio_get_value_cansleep(unsigned gpi
>
> might_sleep_if(extra_checks);
> chip = gpio_to_chip(gpio);
> - return chip->get(chip, gpio - chip->base);
> + return chip->get ? chip->get(chip, gpio - chip->base) : 0;
Why don't we check the .set in the gpio_set_value? Because
we must always call gpio_direction_output()? It is not exactly the
same we work with the input direction.. is this documented anywhere?
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
next prev parent reply other threads:[~2008-10-16 16:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-16 15:45 [patch] gpiolib: fix oops in gpio_get_value_cansleep() David Brownell
2008-10-16 16:43 ` Anton Vorontsov [this message]
2008-10-16 17:06 ` David Brownell
2008-10-16 17:15 ` Anton Vorontsov
2008-10-16 23:17 ` Andrew Morton
2008-10-17 0:44 ` David Brownell
2008-10-17 0:54 ` Andrew Morton
2008-10-17 2:45 ` [stable] " Greg KH
2008-10-17 3:00 ` David Brownell
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=20081016164330.GB27938@oksana.dev.rtsoft.ru \
--to=avorontsov@ru.mvista.com \
--cc=akpm@linux-foundation.org \
--cc=david-b@pacbell.net \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox