mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-17 06:39:37 +02:00
drm/amd/pm: fix the Out-of-bounds read warning
[ Upstream commit 12c6967428
]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
4711b1347c
commit
f1e261ced9
|
@ -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++;
|
||||
|
|
Loading…
Reference in New Issue
Block a user