mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 04:56:13 +02:00
drm/amd/pm: Fix a memory leak on an error path
[ Upstream commit828f8e3137] Add missing free on an error path. Fixes:511a95552e("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
d04ff5437a
commit
cc9742165a
|
|
@ -1968,8 +1968,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, 3);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user