]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amd/display: Use kmalloc_array() instead of kmalloc()
authorJames Flowers <bold.zone2373@fastmail.com>
Sat, 13 Sep 2025 05:19:52 +0000 (22:19 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Sep 2025 21:47:11 +0000 (17:47 -0400)
commit70db83e2b9064bc427d1a7003e516b3400a8ceda
treeadbfbf9f0b7896de2ae8edf57c6c3540159c3b25
parent39203f5e6dcf2b0529ae526004e7a9c8ef453ae2
drm/amd/display: Use kmalloc_array() instead of kmalloc()

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. This could lead to
buffer overflow in code similar to the memcpy in
amdgpu_dm_plane_add_modifier().

Signed-off-by: James Flowers <bold.zone2373@fastmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c