Commit 5a195c6d authored by Thor Thayer's avatar Thor Thayer Committed by Linus Walleij

gpio: gpiolib-devprop: Check chip->parent pointer before dereferencing

Confirm the chip->parent is valid before dereferencing because
the parent parameter is optional.
Signed-off-by: default avatarThor Thayer <tthayer@opensource.altera.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent f85522c2
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment