mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 03:10:30 -04:00
drm/amd/pm: fix the Out-of-bounds read warning
using index i - 1U may beyond element index for mc_data[] when i = 0. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Tim Huang <Tim.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
6e46b89f40
commit
12c6967428
@@ -73,8 +73,9 @@ static int atomctrl_retrieve_ac_timing(
|
||||
j++;
|
||||
} else if ((table->mc_reg_address[i].uc_pre_reg_data &
|
||||
LOW_NIBBLE_MASK) == DATA_EQU_PREV) {
|
||||
table->mc_reg_table_entry[num_ranges].mc_data[i] =
|
||||
table->mc_reg_table_entry[num_ranges].mc_data[i-1];
|
||||
if (i)
|
||||
table->mc_reg_table_entry[num_ranges].mc_data[i] =
|
||||
table->mc_reg_table_entry[num_ranges].mc_data[i-1];
|
||||
}
|
||||
}
|
||||
num_ranges++;
|
||||
|
||||
Reference in New Issue
Block a user