Re: [PATCH] net: dsa: loop: Check for memory allocation failure

2017-05-06 Thread Andrew Lunn
On Sat, May 06, 2017 at 07:29:45AM +0200, Christophe JAILLET wrote: > If 'devm_kzalloc' fails, a NULL pointer will be dereferenced. > Return -ENOMEM instead, as done for some other memory allocation just a > few lines above. > > Fixes: 98cd1552ea27 ("net: dsa: Mock-up driver") > > Signed-off-by:

Re: [PATCH] net: dsa: loop: Check for memory allocation failure

2017-05-07 Thread Florian Fainelli
Le 05/05/17 à 22:29, Christophe JAILLET a écrit : > If 'devm_kzalloc' fails, a NULL pointer will be dereferenced. > Return -ENOMEM instead, as done for some other memory allocation just a > few lines above. > > Fixes: 98cd1552ea27 ("net: dsa: Mock-up driver") > > Signed-off-by: Christophe JAILLET

RE: [PATCH] net: dsa: loop: Check for memory allocation failure

2017-05-08 Thread David Laight
From: Christophe JAILLET > Sent: 06 May 2017 06:30 > If 'devm_kzalloc' fails, a NULL pointer will be dereferenced. > Return -ENOMEM instead, as done for some other memory allocation just a > few lines above. ... > --- a/drivers/net/dsa/dsa_loop.c > +++ b/drivers/net/dsa/dsa_loop.c > @@ -256,6 +256,

RE: [PATCH] net: dsa: loop: Check for memory allocation failure

2017-05-08 Thread Julia Lawall
On Mon, 8 May 2017, David Laight wrote: > From: Christophe JAILLET > > Sent: 06 May 2017 06:30 > > If 'devm_kzalloc' fails, a NULL pointer will be dereferenced. > > Return -ENOMEM instead, as done for some other memory allocation just a > > few lines above. > ... > > --- a/drivers/net/dsa/dsa_lo

Re: [PATCH] net: dsa: loop: Check for memory allocation failure

2017-05-08 Thread David Miller
From: Christophe JAILLET Date: Sat, 6 May 2017 07:29:45 +0200 > If 'devm_kzalloc' fails, a NULL pointer will be dereferenced. > Return -ENOMEM instead, as done for some other memory allocation just a > few lines above. > > Fixes: 98cd1552ea27 ("net: dsa: Mock-up driver") > > Signed-off-by: Chr

Re: [PATCH] net: dsa: loop: Check for memory allocation failure

2017-05-08 Thread Joe Perches
On Mon, 2017-05-08 at 20:32 +0800, Julia Lawall wrote: > > On Mon, 8 May 2017, David Laight wrote: > > > From: Christophe JAILLET > > > Sent: 06 May 2017 06:30 > > > If 'devm_kzalloc' fails, a NULL pointer will be dereferenced. > > > Return -ENOMEM instead, as done for some other memory allocatio

Re: [PATCH] net: dsa: loop: Check for memory allocation failure

2017-05-08 Thread Julia Lawall
On Mon, 8 May 2017, Joe Perches wrote: > On Mon, 2017-05-08 at 20:32 +0800, Julia Lawall wrote: > > > > On Mon, 8 May 2017, David Laight wrote: > > > > > From: Christophe JAILLET > > > > Sent: 06 May 2017 06:30 > > > > If 'devm_kzalloc' fails, a NULL pointer will be dereferenced. > > > > Return

Re: [PATCH] net: dsa: loop: Check for memory allocation failure

2017-05-08 Thread Florian Fainelli
On 05/08/2017 04:46 PM, Julia Lawall wrote: > > > On Mon, 8 May 2017, Joe Perches wrote: > >> On Mon, 2017-05-08 at 20:32 +0800, Julia Lawall wrote: >>> >>> On Mon, 8 May 2017, David Laight wrote: >>> From: Christophe JAILLET > Sent: 06 May 2017 06:30 > If 'devm_kzalloc' fails, a NU

Re: [PATCH] net: dsa: loop: Check for memory allocation failure

2017-05-08 Thread Julia Lawall
On Mon, 8 May 2017, Florian Fainelli wrote: > On 05/08/2017 04:46 PM, Julia Lawall wrote: > > > > > > On Mon, 8 May 2017, Joe Perches wrote: > > > >> On Mon, 2017-05-08 at 20:32 +0800, Julia Lawall wrote: > >>> > >>> On Mon, 8 May 2017, David Laight wrote: > >>> > From: Christophe JAILLET >

Re: [PATCH] net: dsa: loop: Check for memory allocation failure

2017-05-09 Thread Joe Perches
On Mon, 2017-05-08 at 17:35 -0700, Florian Fainelli wrote: > On 05/08/2017 04:46 PM, Julia Lawall wrote: > > On Mon, 8 May 2017, Joe Perches wrote: > > > Each time -EPROBE_DEFER occurs, another set of calls to > > > dsa_switch_alloc and dev_kzalloc also occurs. > > > > > > Perhaps it'd be better t