mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 07:33:19 +02:00
drm/gud: Use kmalloc_array() instead of kmalloc()
Replace kmalloc with kmalloc array in drm/gud/gud_pipe.c since the calculation inside kmalloc is dynamic 'width * height' Signed-off-by: Mehdi Ben Hadj Khelifa <mehdi.benhadjkhelifa@gmail.com> Acked-by: Ruben Wauters <rubenru09@aol.com> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20251007083320.29018-1-mehdi.benhadjkhelifa@gmail.com
This commit is contained in:
parent
d847dc29d0
commit
6035258463
|
|
@ -69,7 +69,7 @@ static size_t gud_xrgb8888_to_r124(u8 *dst, const struct drm_format_info *format
|
|||
height = drm_rect_height(rect);
|
||||
len = drm_format_info_min_pitch(format, 0, width) * height;
|
||||
|
||||
buf = kmalloc(width * height, GFP_KERNEL);
|
||||
buf = kmalloc_array(height, width, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user