Re: [PATCH] drm/ssd130x: Use kmalloc_array() instead of kmalloc()
From: Javier Martinez Canillas
Date: Wed Sep 17 2025 - 05:33:34 EST
James Flowers <bold.zone2373@xxxxxxxxxxxx> writes:
Hello James,
Thanks for the patch.
> Documentation/process/deprecated.rst recommends against the use of
> kmalloc with dynamic size calculations due to the risk of overflow and
> smaller allocation being made than the caller was expecting.
> kmalloc_array avoids this issue.
>
> Signed-off-by: James Flowers <bold.zone2373@xxxxxxxxxxxx>
> ---
Reviewed-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat