summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2018-01-16 23:44:46 +0100
committerLinus Walleij <linus.walleij@linaro.org>2018-01-17 07:44:16 +0100
commit605f2d34ea52a14744fe3c6b43708bce7e2eb690 (patch)
tree3729b7d397a1f7d6902d5f5af70fb3d6727d0303 /drivers/gpio
parentgpio: stmpe: Delete an unnecessary variable initialisation in stmpe_gpio_probe() (diff)
downloadlinux-605f2d34ea52a14744fe3c6b43708bce7e2eb690.tar.xz
linux-605f2d34ea52a14744fe3c6b43708bce7e2eb690.zip
gpio: of: Fix NPE from OF flags
Some calls to of_get_named_gpio() calls sets the flags argument to NULL because they are not interested in the flags. This caused a null pointer exception since we were unconditionally using these flags. Fix it. Fixes: 6a537d48461d ("gpio: of: Support regulator nonstandard GPIO properties") Cc: Heiner Kallweit <hkallweit1@gmail.com> Reported-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib-of.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 71ba008b7f46..27e8a339310c 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -129,7 +129,8 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np,
if (IS_ERR(desc))
goto out;
- of_gpio_flags_quirks(np, flags);
+ if (flags)
+ of_gpio_flags_quirks(np, flags);
pr_debug("%s: parsed '%s' property of node '%pOF[%d]' - status (%d)\n",
__func__, propname, np, index,