Re: [PATCH] usb: use kcalloc instead of kzalloc

2014-08-19 Thread Alan Stern
On Tue, 19 Aug 2014, Arjun Sreedharan wrote: > kcalloc has protection from integer overflows > which could arise from the multiplication of > number of elements and size. > > Signed-off-by: Arjun Sreedharan As Clemens pointed out, integer overflows cannot occur here. This patch is not

Re: [PATCH] usb: use kcalloc instead of kzalloc

2014-08-19 Thread Clemens Ladisch
Arjun Sreedharan wrote: > kcalloc has protection from integer overflows > which could arise from the multiplication of > number of elements and size. You are implying that such an overflow could arise in this code. This is false. > @@ -380,8 +380,7 @@ static int usb_parse_interface(struct device

[PATCH] usb: use kcalloc instead of kzalloc

2014-08-19 Thread Arjun Sreedharan
kcalloc has protection from integer overflows which could arise from the multiplication of number of elements and size. Signed-off-by: Arjun Sreedharan --- drivers/usb/core/config.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/usb/core/config.c

[PATCH] usb: use kcalloc instead of kzalloc

2014-08-19 Thread Arjun Sreedharan
kcalloc has protection from integer overflows which could arise from the multiplication of number of elements and size. Signed-off-by: Arjun Sreedharan arjun...@gmail.com --- drivers/usb/core/config.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git

Re: [PATCH] usb: use kcalloc instead of kzalloc

2014-08-19 Thread Clemens Ladisch
Arjun Sreedharan wrote: kcalloc has protection from integer overflows which could arise from the multiplication of number of elements and size. You are implying that such an overflow could arise in this code. This is false. @@ -380,8 +380,7 @@ static int usb_parse_interface(struct device

Re: [PATCH] usb: use kcalloc instead of kzalloc

2014-08-19 Thread Alan Stern
On Tue, 19 Aug 2014, Arjun Sreedharan wrote: kcalloc has protection from integer overflows which could arise from the multiplication of number of elements and size. Signed-off-by: Arjun Sreedharan arjun...@gmail.com As Clemens pointed out, integer overflows cannot occur here. This patch