Skip to contentSkip to conversation

drm/amd/powerplay: fix memory leak of hardcoded pptable

PATCH In review Eric Huang 2 participants 2 messages Oct 31, 2017 – Nov 1, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Eric Huang

author
#0 lore raw

PATCH 1/1 drm/amd/powerplay: fix memory leak of hardcoded pptable

---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +3 -0
index d4ff742..9d3bdad 100644
@@ -78,6 +78,9 @@ static int amd_powerplay_destroy(void *handle)
 {
 	struct pp_instance *instance = (struct pp_instance *)handle;
 
+	kfree(instance->hwmgr->hardcode_pp_table);
+	instance->hwmgr->hardcode_pp_table = NULL;
+
 	kfree(instance->hwmgr);
 	instance->hwmgr = NULL;
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1509486006-27816-1-git-send-email-JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org

Reviewed-by Rex Zhu
#2 lore raw

Best Regards
Rex

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Eric Huang
Sent: Wednesday, November 01, 2017 5:40 AM
To: [email protected]
Cc: Huang, JinHuiEric
Subject: [PATCH] drm/amd/powerplay: fix memory leak of hardcoded pptable

---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +3 -1
index d4ff742..9d3bdad 100644
@@ -78,6 +78,9 @@ static int amd_powerplay_destroy(void *handle)  {
 	struct pp_instance *instance = (struct pp_instance *)handle;
 
+	kfree(instance->hwmgr->hardcode_pp_table);
+	instance->hwmgr->hardcode_pp_table = NULL;
+
 	kfree(instance->hwmgr);
 	instance->hwmgr = NULL;
 
--

2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx