From: Michael Walle Date: Fri, 16 Sep 2022 11:01:18 +0000 (+0200) Subject: gpiolib: fix OOB access in quirk callbacks X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8b10ca2f7551e024b60ab5e27d3e3630c029000a;p=linux.git 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 Reviewed-by: Linus Walleij Tested-by: Conor Dooley Reviewed-by: Dmitry Torokhov Tested-by: Marek Szyprowski Tested-by: Biju Das Signed-off-by: Bartosz Golaszewski --- diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 95be5f0d26235..0e4e1291604d6 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,