]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: bail out silently on NULL descriptors
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 30 May 2016 14:48:39 +0000 (16:48 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 30 May 2016 14:56:41 +0000 (16:56 +0200)
commit2e30dd33e6414b5dd7cc3f00192d925ba481cdd8
tree0a8327b8bdf5c49781c8efad73009e4f0bb77719
parentc0dea30a0b39cc81a13e63efcc00a7c5d50eae33
gpio: bail out silently on NULL descriptors

In 2c8a7b4b85c5e398877213f539d928895938f3fc
("gpio: reflect base and ngpio into gpio_device")
assumed that GPIO descriptors are either valid or error
pointers, but gpiod_get_[index_]optional() actually return
NULL descriptors and then all subsequent calls should just
bail out.

Cc: stable@vger.kernel.org
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Fixes: 2c8a7b4b85c5 ("gpio: reflect base and ngpio into gpio_device")
Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c