gpiolib: fix OOB access in quirk callbacks
authorMichael Walle <michael@walle.cc>
Fri, 16 Sep 2022 11:01:18 +0000 (13:01 +0200)
committerBartosz Golaszewski <brgl@bgdev.pl>
Tue, 20 Sep 2022 06:30:57 +0000 (08:30 +0200)
commit8b10ca2f7551e024b60ab5e27d3e3630c029000a
tree37bca9efcaf30b96f786142f6ec1f6d82676751d
parentd9e7f0e320516c660d6f33e6c16a3d99970eb14e
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>
drivers/gpio/gpiolib-of.c