Skip to content

Commit

Permalink
drm/amd/pm: correct the gpu metrics version
Browse files Browse the repository at this point in the history
For V1_0 and V1_1, they come with different size. Misuse may cause
out of memory access.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Evan Quan authored and Alex Deucher committed Mar 24, 2021
1 parent a85ba00 commit 2d78b8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static int aldebaran_tables_init(struct smu_context *smu)
return -ENOMEM;
smu_table->metrics_time = 0;

smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v1_0);
smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v1_1);
smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL);
if (!smu_table->gpu_metrics_table) {
kfree(smu_table->metrics_table);
Expand Down

0 comments on commit 2d78b8d

Please sign in to comment.