Re: [PATCH] gpiolib: fix OOB access in quirk callbacks

From: Linus Walleij
Date: Fri Sep 16 2022 - 07:19:23 EST


On Fri, Sep 16, 2022 at 1:01 PM Michael Walle <michael@xxxxxxxx> wrote:

> 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@xxxxxxxx>

Looks correct, an alternative would be to have the for-loop use
ARRAY_SIZE() but this is just as good.

Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Yours,
Linus Walleij