]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdgpu/atom: Check kcalloc() for WS buffer in amdgpu_atom_execute_table_locked()
authorGuangshuo Li <lgs201920130244@gmail.com>
Thu, 18 Sep 2025 10:57:05 +0000 (18:57 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 18 Sep 2025 20:59:27 +0000 (16:59 -0400)
commitcc9a8e238e42c1f43b98c097995137d644b69245
tree34b886e43f104b7152a95e40ff826661861082d3
parent59e4405e9ee2b318342d252422a82dd863b89ef4
drm/amdgpu/atom: Check kcalloc() for WS buffer in amdgpu_atom_execute_table_locked()

kcalloc() may fail. When WS is non-zero and allocation fails, ectx.ws
remains NULL while ectx.ws_size is set, leading to a potential NULL
pointer dereference in atom_get_src_int() when accessing WS entries.

Return -ENOMEM on allocation failure to avoid the NULL dereference.

Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/atom.c