Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <Tim.Huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Tim Huang and committed by
Alex Deucher
51dfc0a4 8944acd0

+2
+2
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
··· 1484 1484 (u32)le32_to_cpu(*((u32 *)reg_data + j)); 1485 1485 j++; 1486 1486 } else if ((reg_table->mc_reg_address[i].pre_reg_data & LOW_NIBBLE_MASK) == DATA_EQU_PREV) { 1487 + if (i == 0) 1488 + continue; 1487 1489 reg_table->mc_reg_table_entry[num_ranges].mc_data[i] = 1488 1490 reg_table->mc_reg_table_entry[num_ranges].mc_data[i - 1]; 1489 1491 }