Skip to content

Commit ff08b99

Browse files
alexdeuchersfX-bot
authored andcommitted
drm/radeon: fix UBSAN warning in kv_dpm.c
commit a498df5421fd737d11bfd152428ba6b1c8538321 upstream. Adds bounds check for sumo_vid_mapping_entry. Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f00dbb0 commit ff08b99

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/radeon/sumo_dpm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,8 @@ void sumo_construct_vid_mapping_table(struct radeon_device *rdev,
16191619

16201620
for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) {
16211621
if (table[i].ulSupportedSCLK != 0) {
1622+
if (table[i].usVoltageIndex >= SUMO_MAX_NUMBER_VOLTAGES)
1623+
continue;
16221624
vid_mapping_table->entries[table[i].usVoltageIndex].vid_7bit =
16231625
table[i].usVoltageID;
16241626
vid_mapping_table->entries[table[i].usVoltageIndex].vid_2bit =

0 commit comments

Comments
 (0)