mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
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:
parent
68af620c9a
commit
1394a4926f
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user