Re: [patch] max17042_battery: fix a couple buffer overflows

2012-05-04 Thread Anton Vorontsov
On Thu, Mar 15, 2012 at 10:20:34AM -0700, Dirk Brandewie wrote: On 03/15/2012 04:37 AM, Dan Carpenter wrote: There are a couple issues here caused by confusion between sizeof() and ARRAY_SIZE(). table_size should be the number of elements, but we should allocate it with kcalloc() so that we

[patch] max17042_battery: fix a couple buffer overflows

2012-03-27 Thread Dan Carpenter
There are a couple issues here caused by confusion between sizeof() and ARRAY_SIZE(). table_size should be the number of elements, but we should allocate it with kcalloc() so that we allocate the correct number of bytes. In max17042_init_model() we don't allocate enough space so we go past the

Re: [patch] max17042_battery: fix a couple buffer overflows

2012-03-15 Thread Dirk Brandewie
On 03/15/2012 04:37 AM, Dan Carpenter wrote: There are a couple issues here caused by confusion between sizeof() and ARRAY_SIZE(). table_size should be the number of elements, but we should allocate it with kcalloc() so that we allocate the correct number of bytes. In max17042_init_model() we

Re: [patch] max17042_battery: fix a couple buffer overflows

2012-03-15 Thread Dirk Brandewie
On 03/15/2012 04:37 AM, Dan Carpenter wrote: There are a couple issues here caused by confusion between sizeof() and ARRAY_SIZE(). table_size should be the number of elements, but we should allocate it with kcalloc() so that we allocate the correct number of bytes. In max17042_init_model() we