Skip to content

Commit

Permalink
drm/amd/pm: Fix a memory leak in an error handling path in 'vangogh_t…
Browse files Browse the repository at this point in the history
…ables_init()'

[ Upstream commit 5126da7 ]

'watermarks_table' must be freed instead 'clocks_table', because
'clocks_table' is known to be NULL at this point and 'watermarks_table' is
never freed if the last kzalloc fails.

Fixes: c98ee89 ("drm/amd/pm: add the fine grain tuning function for vangogh")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
tititiou36 authored and gregkh committed Aug 18, 2021
1 parent fd0b94e commit 466f550
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
Expand Up @@ -242,7 +242,7 @@ static int vangogh_tables_init(struct smu_context *smu)
return 0;

err3_out:
kfree(smu_table->clocks_table);
kfree(smu_table->watermarks_table);
err2_out:
kfree(smu_table->gpu_metrics_table);
err1_out:
Expand Down

0 comments on commit 466f550

Please sign in to comment.