drm/amd/pm: fix a memleak in aldebaran_tables_init
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Thu, 23 Nov 2023 07:33:22 +0000 (15:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Dec 2023 07:52:25 +0000 (08:52 +0100)
commit6832e5396d68c182871447d438af259d08ee7d36
treee2ee70b467fb7207587180e8ad32cf343e5a758d
parent9d00fe295c8f309c21177114777f900971375928
drm/amd/pm: fix a memleak in aldebaran_tables_init

[ Upstream commit 7a88f23e768491bae653b444a96091d2aaeb0818 ]

When kzalloc() for smu_table->ecc_table fails, we should free
the previously allocated resources to prevent memleak.

Fixes: edd794208555 ("drm/amd/pm: add message smu to get ecc_table v2")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c