Re: [PATCH 1/4] gpiolib: check descriptors validity before use

2013-02-26 Thread Grant Likely
On Fri, 15 Feb 2013 14:46:14 +0900, Alexandre Courbot wrote: > Some functions dereferenced their GPIO descriptor argument without > checking its validity first, potentially leading to an oops when given > an invalid argument. > > This patch also makes gpio_get_value() more resilient when given a

[PATCH 1/4] gpiolib: check descriptors validity before use

2013-02-14 Thread Alexandre Courbot
Some functions dereferenced their GPIO descriptor argument without checking its validity first, potentially leading to an oops when given an invalid argument. This patch also makes gpio_get_value() more resilient when given an invalid GPIO, returning 0 instead of silently crashing. Signed-off-by:

Re: [PATCH 1/4] gpiolib: check descriptors validity before use

2013-02-13 Thread Alexandre Courbot
On Thu, Feb 14, 2013 at 7:49 AM, Ryan Mallon wrote: > Is it really useful to use the same pr_debug for the error case? Why not do: > > desc = gpio_to_desc(gpio); > if (!desc) { > pr_debug("%s - Invalid gpio %d\n", __func__, gpio); > return -EINVAL; >

Re: [PATCH 1/4] gpiolib: check descriptors validity before use

2013-02-13 Thread Ryan Mallon
On 13/02/13 18:02, Alexandre Courbot wrote: > From: Alexandre Courbot > > Some functions dereferenced their GPIO descriptor argument without > checking its validity first, potentially leading to an oops when given > an invalid argument. > > This patch also makes gpio_get_value() more resilient w

[PATCH 1/4] gpiolib: check descriptors validity before use

2013-02-12 Thread Alexandre Courbot
From: Alexandre Courbot Some functions dereferenced their GPIO descriptor argument without checking its validity first, potentially leading to an oops when given an invalid argument. This patch also makes gpio_get_value() more resilient when given an invalid GPIO, returning 0 instead of oopsing.