summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib-of.c
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2022-09-16 13:01:18 +0200
committerBartosz Golaszewski <brgl@bgdev.pl>2022-09-20 08:30:57 +0200
commit8b10ca2f7551e024b60ab5e27d3e3630c029000a (patch)
tree37bca9efcaf30b96f786142f6ec1f6d82676751d /drivers/gpio/gpiolib-of.c
parentd9e7f0e320516c660d6f33e6c16a3d99970eb14e (diff)
downloadlinux-8b10ca2f7551e024b60ab5e27d3e3630c029000a.tar.bz2
gpiolib: fix OOB access in quirk callbacks
Commit a2b5e207cade ("gpiolib: rework quirk handling in of_find_gpio()") introduced an array of quirk functions which get iterated over. But a sentinal value is missing. Add it. Fixes: a2b5e207cade ("gpiolib: rework quirk handling in of_find_gpio()") Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Biju Das <biju.das.jz@bp.renesas.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Diffstat (limited to 'drivers/gpio/gpiolib-of.c')
-rw-r--r--drivers/gpio/gpiolib-of.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 95be5f0d2623..0e4e1291604d 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -498,6 +498,7 @@ static const of_find_gpio_quirk of_find_gpio_quirks[] = {
of_find_regulator_gpio,
of_find_arizona_gpio,
of_find_usb_gpio,
+ NULL
};
struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,