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

Andy Shevchenko andy at kernel.org
Thu Mar 7 05:23:29 PST 2024


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 at alliedtelesis.co.nz> 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





More information about the linux-arm-kernel mailing list