[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75Vdi8K2mf2JSCG=e4vX+18CuNyaH-U5Q8-NGvihhyrJBJg@mail.gmail.com>
Date: Wed, 6 Mar 2024 12:58:24 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Chris Packham <Chris.Packham@...iedtelesis.co.nz>
Cc: Andy Shevchenko <andy@...nel.org>, Geert Uytterhoeven <geert@...ux-m68k.org>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"krzysztof.kozlowski+dt@...aro.org" <krzysztof.kozlowski+dt@...aro.org>,
"conor+dt@...nel.org" <conor+dt@...nel.org>, "andrew@...n.ch" <andrew@...n.ch>,
"gregory.clement@...tlin.com" <gregory.clement@...tlin.com>,
"sebastian.hesselbarth@...il.com" <sebastian.hesselbarth@...il.com>, "lee@...nel.org" <lee@...nel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>,
"linux-leds@...r.kernel.org" <linux-leds@...r.kernel.org>
Subject: Re: [PATCH v4 1/3] auxdisplay: Add 7-segment LED display driver
On Wed, Mar 6, 2024 at 12:34 AM Chris Packham
<Chris.Packham@...iedtelesis.co.nz> wrote:
> On 6/03/24 03:57, Andy Shevchenko wrote:
> > On Tue, Mar 05, 2024 at 09:23:07AM +0100, Geert Uytterhoeven wrote:
> >> On Tue, Mar 5, 2024 at 4:59 AM Chris Packham
> >> <chris.packham@...iedtelesis.co.nz> wrote:
..
> >>> + priv->segment_gpios = devm_gpiod_get_array(dev, "segment", GPIOD_OUT_LOW);
> >>> + if (IS_ERR(priv->segment_gpios))
> >>> + return PTR_ERR(priv->segment_gpios);
> >> This needs some validation of priv->segment_gpios->ndescs, else the
> >> call to gpiod_set_array_value_cansleep() in seg_led_update() may
> >> trigger an out-of-bounds access of the values bitmap.
> > Alternatively we can call gpiod_count() beforehand and check its result.
> Unless there are any objections I think I'll go with the ndescs check as
> it'll be easier to update to the subnode style in the future.
Either works for me.
> It does
> mean there will be some extra allocations/frees (handled via the devm_
> APIs) in the error case.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists