[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cbfb9094-2574-4e00-b401-1ddd81a2850b@moroto.mountain>
Date: Thu, 28 Mar 2024 19:45:03 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Alexander Lobakin <aleksander.lobakin@...el.com>
Cc: Aleksandr Mishin <amishin@...rgos.ru>, Keerthy <j-keerthy@...com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>, "Andrew F. Davis" <afd@...com>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
lvc-project@...uxtesting.org
Subject: Re: [PATCH] gpio: davinci: Fix potential buffer overflow
On Thu, Mar 28, 2024 at 04:27:24PM +0100, Alexander Lobakin wrote:
> > diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
> > index bb499e362912..b65df1f2b83f 100644
> > --- a/drivers/gpio/gpio-davinci.c
> > +++ b/drivers/gpio/gpio-davinci.c
> > @@ -257,6 +257,9 @@ static int davinci_gpio_probe(struct platform_device *pdev)
> > spin_lock_init(&chips->lock);
> >
> > nbank = DIV_ROUND_UP(ngpio, 32);
> > + if (nbank > MAX_REGS_BANKS || nbank > 5) {
> > + nbank = MAX_REGS_BANKS < 5 ? MAX_REGS_BANKS : 5;
> > + }
>
> Static analysis warnings make no sense until you provide a reliable way
> to trigger the problem on real systems.
This patch isn't correct, but we merge a few static checker fixes every
day.
regards,
dan carpenter
Powered by blists - more mailing lists