Re: Re: [PATCH v1] pinctrl: ralink: rt2880: Check for return value of devm_kcalloc()

2022-04-01 Thread Andy Shevchenko
On Fri, Apr 1, 2022 at 6:06 AM unSimple wrote: > > The main consideration of the 'continue' in the patch is that those > statements are inner a loop. > > The next allocation may be successful so I think it is better to use > 'continue' here. Please, do not top-post! What you explained is logi

Re: [PATCH v1] pinctrl: ralink: rt2880: Check for return value of devm_kcalloc()

2022-03-29 Thread Andy Shevchenko
On Tue, Mar 29, 2022 at 11:36 AM QintaoShen wrote: > > The memory allocation function devm_kcalloc() may return NULL pointer, may --> might > so it is better to add a check for 'p->func[i]->pins' to avoid possible > NULL pointer dereference. ... > @@ -266,6 +266,10 @@ static int rt2880_pinmux_

Re: [PATCH v1] pinctrl: ralink: rt2880: Check for return value of devm_kcalloc()

2022-03-29 Thread Greg KH
On Tue, Mar 29, 2022 at 03:50:12PM +0800, QintaoShen wrote: > The memory allocation function devm_kcalloc() may return NULL pointer, > so it is better to add a check for 'p->func[i]->pins' to avoid possible > NULL pointer dereference. > > Signed-off-by: QintaoShen > --- > drivers/pinctrl/ralink/

[PATCH v1] pinctrl: ralink: rt2880: Check for return value of devm_kcalloc()

2022-03-29 Thread QintaoShen
The memory allocation function devm_kcalloc() may return NULL pointer, so it is better to add a check for 'p->func[i]->pins' to avoid possible NULL pointer dereference. Signed-off-by: QintaoShen --- drivers/pinctrl/ralink/pinctrl-rt2880.c | 4 1 file changed, 4 insertions(+) diff --git a/d