Skip to content

Commit 238d468

Browse files
Yang Wangalexdeucher
authored andcommitted
drm/amd/pm: fix smu table id bound check issue in smu_cmn_update_table()
'table_index' is a variable defined by the smu driver (kmd) 'table_id' is a variable defined by the hw smu (pmfw) This code should use table_index as a bounds check. Fixes: caad261 ("drm/amd/powerplay: move table setting common code to smu_cmn.c") Signed-off-by: Yang Wang <kevinyang.wang@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit fca0c66b22303de0d1d6313059baf4dc960a4753)
1 parent 382bd6a commit 238d468

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ int smu_cmn_update_table(struct smu_context *smu,
969969
table_index);
970970
uint32_t table_size;
971971
int ret = 0;
972-
if (!table_data || table_id >= SMU_TABLE_COUNT || table_id < 0)
972+
if (!table_data || table_index >= SMU_TABLE_COUNT || table_id < 0)
973973
return -EINVAL;
974974

975975
table_size = smu_table->tables[table_index].size;

0 commit comments

Comments
 (0)