Skip to content

Commit

Permalink
gpiolib: fix OOB access in quirk callbacks
Browse files Browse the repository at this point in the history
Commit a2b5e20 ("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: a2b5e20 ("gpiolib: rework quirk handling in of_find_gpio()")
Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Tested-by: Conor Dooley <[email protected]>
Reviewed-by: Dmitry Torokhov <[email protected]>
Tested-by: Marek Szyprowski <[email protected]>
Tested-by: Biju Das <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
  • Loading branch information
mwalle authored and brgl committed Sep 20, 2022
1 parent d9e7f0e commit 8b10ca2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpio/gpiolib-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8b10ca2

Please sign in to comment.