drm/amd/pm: Fix a memory leak on an error path
Add missing free on an error path. Fixes: 511a95552ec8 ("drm/amd/pm: Add SMU 13.0.6 support") Reviewed-by: Yang Wang <kevinyang.wang@amd.com> Signed-off-by: Kunwu.Chan <chentao@kylinos.cn> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
28ab9a02b6
commit
828f8e3137
@ -2035,8 +2035,10 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table
|
||||
|
||||
metrics = kzalloc(sizeof(MetricsTable_t), GFP_KERNEL);
|
||||
ret = smu_v13_0_6_get_metrics_table(smu, metrics, true);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
kfree(metrics);
|
||||
return ret;
|
||||
}
|
||||
|
||||
smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 4);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user