drm/amd/pm: fix smu table id bound check issue in smu_cmn_update_table()
Subsystems (3)
PATCH 1/1 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.
--- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +1 -1
@@ -969,7 +969,7 @@ int smu_cmn_update_table(struct smu_context *smu, table_index);uint32_t table_size;int ret =0 ; -if (!table_data || table_id >=SMU_TABLE_COUNT || table_id <0 ) +if (!table_data || table_index >=SMU_TABLE_COUNT || table_id <0 )return -EINVAL ; table_size = smu_table->tables[table_index].size;
Signature · 1 line
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
Regards,
Hawking
-----Original Message-----
From: Wang, Yang(Kevin) <[email protected]>
Sent: Wednesday, October 22, 2025 14:29
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>
Subject: [PATCH] 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.
--- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +1 -1
@@ -969,7 +969,7 @@ int smu_cmn_update_table(struct smu_context *smu, table_index);uint32_t table_size;int ret =0 ; -if (!table_data || table_id >=SMU_TABLE_COUNT || table_id <0 ) +if (!table_data || table_index >=SMU_TABLE_COUNT || table_id <0 )return -EINVAL ; table_size = smu_table->tables[table_index].size;
--
2.34.1