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:51:19 +0000 (08:51 +0100)
commit0e0a95166882e594af4ab4f8c6f7894c2c32f6a9
treef72b1765058ace8cd65ca70117debf4ab8e7d430
parent59862b869275c27beb25cda2054b59a8b5d04970
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