Re: [PATCH] leds: lp50xx: Read default intensity from devicetree

From: Tobias Johansson

Date: Wed Dec 02 2026 - 08:43:13 EST


On Wed, 2026-12-02 at 12:09 +0000, Lee Jones wrote:
> On Mon, 23 Nov 2026, Tobias Johansson wrote:
>
> > On Thu, 2026-11-19 at 09:52 +0000, Lee Jones wrote:
> > > On Mon, 09 Nov 2026, Tobias Johansson wrote:
> > > > + fwnode_property_read_u32(led_node,
> > > > "default-intensity",
> > > > +
> > > > &mc_led_info[multi_index].intensity);
> > >
> > > (multi_index >= LP50XX_LEDS_PER_MODULE) only tests for values too
> > > large.
> > >
> > > What happens if `multi_index` is < 0?  OOB?
> > >
> >
> > Yes, good catch. multi_index is read with
> > fwnode_property_read_u32()
> > into a signed int, so values with the high bit set become negative
> > and
> > bypass the upper-bound check, causing an OOB write. I can change
> > multi_index to u32 so the existing check covers it.
> >
> > Since both issues are pre-existing and caused by malformed
> > devicetrees,
> > I can send up a new patch series to fix these two issues hopefully
> > sometime this week.
>
> It would be ideal if you could include this patch as part of the set.

Fair enough, I'll merge all three patches into one series.


// Tobias