Re: [PATCH v5 1/3] auxdisplay: Add 7-segment LED display driver

From: Andy Shevchenko
Date: Thu Mar 07 2024 - 08:23:45 EST


On Thu, Mar 07, 2024 at 02:13:23PM +0100, Geert Uytterhoeven wrote:
> On Thu, Mar 7, 2024 at 12:50 AM Chris Packham
> <chris.packham@xxxxxxxxxxxxxxxxxxx> wrote:

..

> > + DECLARE_BITMAP(values, 8) = { 0 };

While doing next version, drop this '0', as we have in another terminator
the same approach (i.o.w. for the sake of consistency).

..

> > + gpiod_set_array_value_cansleep(priv->segment_gpios->ndescs, priv->segment_gpios->desc,
> > + priv->segment_gpios->info, values);
>
> This may still cause an out-of-bounds access of values if ndescs > 8.

Not really. It will be only for ndescs >= 32 (on 32-bit) or 64
(on 64-bit accordingly).

But good catch, we better to narrow the range down.

--
With Best Regards,
Andy Shevchenko