Re: [PATCH 1/1 net-next] net: dsa: replace count*size kmalloc by kmalloc_array

2014-11-16 Thread David Miller
From: Fabian Frederick Date: Fri, 14 Nov 2014 19:36:42 +0100 > kmalloc_array manages count*sizeof overflow. > > Signed-off-by: Fabian Frederick Applied, and yes I read Joe's feedback and the rest of this thread wrt. sizeof(u8/s8). That can be done as a followup. -- To unsubscribe from this li

Re: [PATCH 1/1 net-next] net: dsa: replace count*size kmalloc by kmalloc_array

2014-11-14 Thread Joe Perches
On Fri, 2014-11-14 at 20:32 +0100, Fabian Frederick wrote: > On 14 November 2014 at 20:14 Joe Perches wrote: > > On Fri, 2014-11-14 at 20:02 +0100, Fabian Frederick wrote: > > > On 14 November 2014 at 19:47 Joe Perches wrote: > > > > On Fri, 2014-11-14 at 19:36 +0100, Fabian Frederick wrote: > >

Re: [PATCH 1/1 net-next] net: dsa: replace count*size kmalloc by kmalloc_array

2014-11-14 Thread Fabian Frederick
> On 14 November 2014 at 20:14 Joe Perches wrote: > > > On Fri, 2014-11-14 at 20:02 +0100, Fabian Frederick wrote: > > On 14 November 2014 at 19:47 Joe Perches wrote: > > > On Fri, 2014-11-14 at 19:36 +0100, Fabian Frederick wrote: > > > > kmalloc_array manages count*sizeof overflow. > > > > >

Re: [PATCH 1/1 net-next] net: dsa: replace count*size kmalloc by kmalloc_array

2014-11-14 Thread Joe Perches
On Fri, 2014-11-14 at 20:02 +0100, Fabian Frederick wrote: > On 14 November 2014 at 19:47 Joe Perches wrote: > > On Fri, 2014-11-14 at 19:36 +0100, Fabian Frederick wrote: > > > kmalloc_array manages count*sizeof overflow. > > > > Fundamentally correct, but is this necessary or useful? > > sizeof(

Re: [PATCH 1/1 net-next] net: dsa: replace count*size kmalloc by kmalloc_array

2014-11-14 Thread Fabian Frederick
> On 14 November 2014 at 19:47 Joe Perches wrote: > > > On Fri, 2014-11-14 at 19:36 +0100, Fabian Frederick wrote: > > kmalloc_array manages count*sizeof overflow. > > Fundamentally correct, but is this necessary or useful? > sizeof(s8) isn't often going to be anything other than 1. Absolutely,

Re: [PATCH 1/1 net-next] net: dsa: replace count*size kmalloc by kmalloc_array

2014-11-14 Thread Joe Perches
On Fri, 2014-11-14 at 19:36 +0100, Fabian Frederick wrote: > kmalloc_array manages count*sizeof overflow. Fundamentally correct, but is this necessary or useful? sizeof(s8) isn't often going to be anything other than 1. Would the kernel even work without that assumption? > diff --git a/net/dsa/