Commit 2d78b8d6 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/pm: correct the gpu metrics version

For V1_0 and V1_1, they come with different size. Misuse may cause
out of memory access.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarKevin Wang <kevin1.wang@amd.com>
Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a85ba005
...@@ -206,7 +206,7 @@ static int aldebaran_tables_init(struct smu_context *smu) ...@@ -206,7 +206,7 @@ static int aldebaran_tables_init(struct smu_context *smu)
return -ENOMEM; return -ENOMEM;
smu_table->metrics_time = 0; 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); smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL);
if (!smu_table->gpu_metrics_table) { if (!smu_table->gpu_metrics_table) {
kfree(smu_table->metrics_table); kfree(smu_table->metrics_table);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment