]> 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)
commita95e6369a412a263db1cfe45fe4cb56f5e73a0d1
tree0a8327b8bdf5c49781c8efad73009e4f0bb77719
parente138a11fb0d125e5385710957a380d5fdb55fe5e
gpio: bail out silently on NULL descriptors

In c5c92ff1f7b3a47a70acf5e1b95f5eafabc48c3b
("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: c5c92ff1f7b3 ("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