Re: [PATCH] backlight: pwm_bl: Avoid open coded arithmetic in memory allocation

2022-02-08 Thread Lee Jones
On Sat, 05 Feb 2022, Christophe JAILLET wrote: > kmalloc_array()/kcalloc() should be used to avoid potential overflow when > a multiplication is needed to compute the size of the requested memory. > > So turn a kzalloc()+explicit size computation into an equivalent kcalloc(). > > Signed-off-by:

Re: [PATCH] backlight: pwm_bl: Avoid open coded arithmetic in memory allocation

2022-02-08 Thread Uwe Kleine-König
On Mon, Feb 07, 2022 at 09:31:00AM +, Lee Jones wrote: > On Mon, 07 Feb 2022, Uwe Kleine-König wrote: > > > On Sat, Feb 05, 2022 at 08:40:48AM +0100, Christophe JAILLET wrote: > > > kmalloc_array()/kcalloc() should be used to avoid potential overflow when > > > a multiplication is needed to co

Re: [PATCH] backlight: pwm_bl: Avoid open coded arithmetic in memory allocation

2022-02-07 Thread Daniel Thompson
On Sat, Feb 05, 2022 at 08:40:48AM +0100, Christophe JAILLET wrote: > kmalloc_array()/kcalloc() should be used to avoid potential overflow when > a multiplication is needed to compute the size of the requested memory. > > So turn a kzalloc()+explicit size computation into an equivalent kcalloc().

Re: [PATCH] backlight: pwm_bl: Avoid open coded arithmetic in memory allocation

2022-02-07 Thread Lee Jones
On Mon, 07 Feb 2022, Uwe Kleine-König wrote: > On Sat, Feb 05, 2022 at 08:40:48AM +0100, Christophe JAILLET wrote: > > kmalloc_array()/kcalloc() should be used to avoid potential overflow when > > a multiplication is needed to compute the size of the requested memory. > > > > So turn a kzalloc()+

Re: [PATCH] backlight: pwm_bl: Avoid open coded arithmetic in memory allocation

2022-02-07 Thread Uwe Kleine-König
On Sat, Feb 05, 2022 at 08:40:48AM +0100, Christophe JAILLET wrote: > kmalloc_array()/kcalloc() should be used to avoid potential overflow when > a multiplication is needed to compute the size of the requested memory. > > So turn a kzalloc()+explicit size computation into an equivalent kcalloc().

[PATCH] backlight: pwm_bl: Avoid open coded arithmetic in memory allocation

2022-02-04 Thread Christophe JAILLET
kmalloc_array()/kcalloc() should be used to avoid potential overflow when a multiplication is needed to compute the size of the requested memory. So turn a kzalloc()+explicit size computation into an equivalent kcalloc(). Signed-off-by: Christophe JAILLET --- drivers/video/backlight/pwm_bl.c |