summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2021-08-05 20:37:14 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-18 09:06:54 +0200
commit466f5509f62ae464b8c0ae9590442c104866c9f4 (patch)
tree1d768be8c913b8f94b6150199aa76c56a0e15d83 /drivers/gpu
parentfd0b94e6b1c73cc37142091b56d76460bd8300b5 (diff)
downloadlinux-stable-466f5509f62ae464b8c0ae9590442c104866c9f4.tar.gz
linux-stable-466f5509f62ae464b8c0ae9590442c104866c9f4.tar.bz2
linux-stable-466f5509f62ae464b8c0ae9590442c104866c9f4.zip
drm/amd/pm: Fix a memory leak in an error handling path in 'vangogh_tables_init()'
[ Upstream commit 5126da7d99cf6396c929f3b577ba3aed1e74acd7 ] '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: c98ee89736b8 ("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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
index 77f532a49e37..bacef9120b8d 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
@@ -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: