projects
/
platform
/
kernel
/
linux-exynos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f85522c
)
gpio: gpiolib-devprop: Check chip->parent pointer before dereferencing
author
Thor Thayer
<tthayer@opensource.altera.com>
Tue, 25 Oct 2016 16:31:23 +0000
(11:31 -0500)
committer
Linus Walleij
<linus.walleij@linaro.org>
Tue, 25 Oct 2016 18:23:19 +0000
(20:23 +0200)
Confirm the chip->parent is valid before dereferencing because
the parent parameter is optional.
Signed-off-by: Thor Thayer <tthayer@opensource.altera.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib-devprop.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/gpiolib-devprop.c
b/drivers/gpio/gpiolib-devprop.c
index
17bfc41
..
27f383b
100644
(file)
--- a/
drivers/gpio/gpiolib-devprop.c
+++ b/
drivers/gpio/gpiolib-devprop.c
@@
-31,6
+31,11
@@
void devprop_gpiochip_set_names(struct gpio_chip *chip)
const char **names;
int ret, i;
+ if (!chip->parent) {
+ dev_warn(&gdev->dev, "GPIO chip parent is NULL\n");
+ return;
+ }
+
ret = device_property_read_string_array(chip->parent, "gpio-line-names",
NULL, 0);
if (ret < 0)