]> git.hungrycats.org Git - linux/commit
drm/amdgpu: validate XCP topology counts before division
authorAsad Kamal <asad.kamal@amd.com>
Tue, 16 Jun 2026 13:24:05 +0000 (21:24 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Jul 2026 15:08:46 +0000 (11:08 -0400)
commit0eda57ee303b4392057b7d4c32e8fda9d14cffad
tree168c2d3c15724bde890af6dca3ccacdea1ba71a6
parentb68f1654927fe841e71816933d0b50efb4f0196d
drm/amdgpu: validate XCP topology counts before division

In aqua_vanjaram_get_xcp_res_info(), max_res[i] can be zero.
When res_lt_xcp is true the code divides num_xcp by max_res[i],
causing a divide fault.

Skip the loop body for absent resources.

v2: Remove redundant checks (Lijo)

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c