[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGztCHNr1jmpFq0A@surfacebook>
Date: Tue, 23 May 2023 19:42:48 +0300
From: andy.shevchenko@...il.com
To: Wells Lu <wellslutw@...il.com>
Cc: linus.walleij@...aro.org, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org, wells.lu@...plus.com
Subject: Re: [PATCH] pinctrl:sunplus: Add check for kmalloc
Tue, May 23, 2023 at 06:11:28PM +0800, Wells Lu kirjoitti:
> Fix Smatch static checker warning:
> potential null dereference 'configs'. (kmalloc returns null)
...
> configs = kmalloc(sizeof(*configs), GFP_KERNEL);
> + if (!configs)
> + return -ENOMEM;
"Fixing" by adding a memory leak is not probably a good approach.
...
> configs = kmalloc(sizeof(*configs), GFP_KERNEL);
> + if (!configs)
> + return -ENOMEM;
Ditto.
...
It might be that I'm mistaken. In this case please add an explanation why in
the commit message.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists