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

From: Lee Jones
Date: Tue Feb 08 2022 - 03:54:09 EST


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: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> ---
> drivers/video/backlight/pwm_bl.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)

Applied, thanks.

--
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog