Re: RFC: Bug in error handling in gpiolib.c

From: Linus Walleij
Date: Thu Aug 29 2013 - 13:45:34 EST


On Tue, Aug 27, 2013 at 9:17 PM, Tim Bird <tbird20d@xxxxxxxxx> wrote:

> Hi all,
>
> There appears to be a bug in the error handling in
> drivers/gpi/gpiolib.c In certain error cases
> desc_to_gpio() is called to get the gpio number
> for an error message, but this may happen on code
> paths where desc->chip is NULL. This causes a panic
> on my system in gpiod_request(), as follows:
(...)
> Here's my patch:
> Subject: [PATCH] gpio: avoid panic on NULL desc->chip in gpiod_request

Patch applied. Unless we come up with something better,
there is some parallel discussion on how to handle NULL
descriptors.

Alexandre: OK to apply this?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/