[AMD Official Use Only - Internal Distribution Only]

! smu->smu_table.max_sustainable_clocks is the preferred coding style. And 
please also remove internal changelist no from commit description.

With above addressed, the patch is

Reviewed-by: Hawking Zhang <[email protected]>

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: Tuesday, February 18, 2020 10:54
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH 2/3] drm/amdgpu: fix memory leak during TDR test

fix system memory leak regression introduced by this previous change of 201331 
- Single VF Mode Test

Signed-off-by: Monk Liu <[email protected]>
---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c 
b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index 9d15acf..3363f1c 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -978,8 +978,12 @@ int smu_v11_0_init_max_sustainable_clocks(struct 
smu_context *smu)
        struct smu_11_0_max_sustainable_clocks *max_sustainable_clocks;
        int ret = 0;
 
-       max_sustainable_clocks = kzalloc(sizeof(struct 
smu_11_0_max_sustainable_clocks),
+       if (smu->smu_table.max_sustainable_clocks == NULL)
+               max_sustainable_clocks = kzalloc(sizeof(struct 
+smu_11_0_max_sustainable_clocks),
                                         GFP_KERNEL);
+       else
+               max_sustainable_clocks = smu->smu_table.max_sustainable_clocks;
+
        smu->smu_table.max_sustainable_clocks = (void *)max_sustainable_clocks;
 
        max_sustainable_clocks->uclock = smu->smu_table.boot_values.uclk / 100;
--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Chawking.zhang%40amd.com%7C25101ac0816b4d8229ea08d7b41dde6e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637175912700145000&amp;sdata=hu7hjIM8mNkrmgCktuZssVeHtoKATywBXI2sGJYbRh0%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to