projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6328c9
)
drm/radeon: fix UBSAN warning in kv_dpm.c
author
Alex Deucher
<alexander.deucher@amd.com>
Mon, 20 May 2024 13:11:45 +0000
(09:11 -0400)
committer
Alex Deucher
<alexander.deucher@amd.com>
Wed, 19 Jun 2024 16:48:10 +0000
(12:48 -0400)
Adds bounds check for sumo_vid_mapping_entry.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/sumo_dpm.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/radeon/sumo_dpm.c
b/drivers/gpu/drm/radeon/sumo_dpm.c
index
21d27e6
..
b11f7c5
100644
(file)
--- a/
drivers/gpu/drm/radeon/sumo_dpm.c
+++ b/
drivers/gpu/drm/radeon/sumo_dpm.c
@@
-1619,6
+1619,8
@@
void sumo_construct_vid_mapping_table(struct radeon_device *rdev,
for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) {
if (table[i].ulSupportedSCLK != 0) {
+ if (table[i].usVoltageIndex >= SUMO_MAX_NUMBER_VOLTAGES)
+ continue;
vid_mapping_table->entries[table[i].usVoltageIndex].vid_7bit =
table[i].usVoltageID;
vid_mapping_table->entries[table[i].usVoltageIndex].vid_2bit =