diff options
| author | Tim Huang <[email protected]> | 2024-05-06 08:30:01 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2024-05-08 19:17:07 +0000 |
| commit | 51dfc0a4d609fe700750a62f41447f01b8c9ea50 (patch) | |
| tree | bdc11b0b02e18b61fd0991cd36192eb4c4499fa2 /drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | |
| parent | drm/amdgpu: fix ucode out-of-bounds read warning (diff) | |
| download | kernel-51dfc0a4d609fe700750a62f41447f01b8c9ea50.tar.gz kernel-51dfc0a4d609fe700750a62f41447f01b8c9ea50.zip | |
drm/amdgpu: fix mc_data out-of-bounds read warning
Clear warning that read mc_data[i-1] may out-of-bounds.
Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index 52b12c1718eb..7dc102f0bc1d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c @@ -1484,6 +1484,8 @@ int amdgpu_atombios_init_mc_reg_table(struct amdgpu_device *adev, (u32)le32_to_cpu(*((u32 *)reg_data + j)); j++; } else if ((reg_table->mc_reg_address[i].pre_reg_data & LOW_NIBBLE_MASK) == DATA_EQU_PREV) { + if (i == 0) + continue; reg_table->mc_reg_table_entry[num_ranges].mc_data[i] = reg_table->mc_reg_table_entry[num_ranges].mc_data[i - 1]; } |
