drm/amdgpu: fix shift-out-of-bounds when updating umc active mask

UMC node_inst_num can exceed 32, causing
(1 << node_inst_num) to shift a 32-bit int
out of bounds

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Hawking Zhang 2026-01-28 18:53:40 +08:00 committed by Alex Deucher
parent 68af620c9a
commit 1394a4926f

View File

@ -793,7 +793,7 @@ static void amdgpu_discovery_read_from_harvest_table(struct amdgpu_device *adev,
struct harvest_table *harvest_info;
u16 offset;
int i;
uint32_t umc_harvest_config = 0;
u64 umc_harvest_config = 0;
if (amdgpu_discovery_get_table_info(adev, &info, HARVEST_INFO))
return;
@ -850,7 +850,7 @@ static void amdgpu_discovery_read_from_harvest_table(struct amdgpu_device *adev,
}
}
adev->umc.active_mask = ((1 << adev->umc.node_inst_num) - 1) &
adev->umc.active_mask = ((1ULL << adev->umc.node_inst_num) - 1ULL) &
~umc_harvest_config;
}