Skip to content

Commit 4829f89

Browse files
ljymonkalexdeucher
authored andcommitted
drm/amdgpu: fix memory leak during TDR test(v2)
fix system memory leak v2: fix coding style Signed-off-by: Monk Liu <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 97d9a4e commit 4829f89

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/gpu/drm/amd/powerplay/smu_v11_0.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,12 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu)
978978
struct smu_11_0_max_sustainable_clocks *max_sustainable_clocks;
979979
int ret = 0;
980980

981-
max_sustainable_clocks = kzalloc(sizeof(struct smu_11_0_max_sustainable_clocks),
981+
if (!smu->smu_table.max_sustainable_clocks)
982+
max_sustainable_clocks = kzalloc(sizeof(struct smu_11_0_max_sustainable_clocks),
982983
GFP_KERNEL);
984+
else
985+
max_sustainable_clocks = smu->smu_table.max_sustainable_clocks;
986+
983987
smu->smu_table.max_sustainable_clocks = (void *)max_sustainable_clocks;
984988

985989
max_sustainable_clocks->uclock = smu->smu_table.boot_values.uclk / 100;

0 commit comments

Comments
 (0)