Skip to contentSkip to conversation

drm/amd/powerplay: fix memory leak in rv_hwmgr backend

PATCH In review Hawking Zhang 2 participants 3 messages Jun 6, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amd/powerplay: fix memory leak in rv_hwmgr backend

vddc_dep_on_dal_pwrl and vq_budgeting_table are allocated and initialized in rv_hwmgr_backend_init. Thus free the memory in rv_hwmgr_backend_fini

Change-Id I15878ccb6a39848b764844e45f2ac375164906ad
---
 drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c +10 -0
index 4e7bb78..f61da66 100644
@@ -670,6 +670,16 @@ static int rv_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
 		pinfo->vdd_dep_on_phyclk = NULL;
 	}
 
+	if (NULL != hwmgr->dyn_state.vddc_dep_on_dal_pwrl) {
+		kfree(hwmgr->dyn_state.vddc_dep_on_dal_pwrl);
+		hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL;
+	}
+
+	if (NULL != hwmgr->dyn_state.vq_budgeting_table) {
+		kfree(hwmgr->dyn_state.vq_budgeting_table);
+		hwmgr->dyn_state.vq_budgeting_table = NULL;
+	}
+
 	kfree(hwmgr->backend);
 	hwmgr->backend = 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): 1496738170-2743-1-git-send-email-Hawking.Zhang-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/2 drm/amd/powerplay: fix memory leak in cz_hwmgr backend

vddc_dep_on_dal_pwrl is allocated and initialized in cz_hwmgr_backend_init Thus free the memory in cz_hwmgr_backend_fini

Change-Id Idd6dd4b76894579674bf334339b71df8559637fd
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +6 -0
index 7aa5ca8..0b74da3 100644
@@ -1224,6 +1224,12 @@ static int cz_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
 		phm_destroy_table(hwmgr, &(hwmgr->disable_dynamic_state_management));
 		phm_destroy_table(hwmgr, &(hwmgr->power_down_asic));
 		phm_destroy_table(hwmgr, &(hwmgr->setup_asic));
+
+		if (NULL != hwmgr->dyn_state.vddc_dep_on_dal_pwrl) {
+			kfree(hwmgr->dyn_state.vddc_dep_on_dal_pwrl);
+			hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL;
+		}
+
 		kfree(hwmgr->backend);
 		hwmgr->backend = 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): 1496738170-2743-2-git-send-email-Hawking.Zhang-5C7GfCeVMHo@public.gmane.org

Reviewed-by Alex Deucher
#4 lore raw

RE: [PATCH 2/2] drm/amd/powerplay: fix memory leak in cz_hwmgr backend

Quoted 9 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Hawking Zhang
Sent: Tuesday, June 06, 2017 4:36 AM
To: [email protected]
Cc: Zhang, Hawking
Subject: [PATCH 2/2] drm/amd/powerplay: fix memory leak in cz_hwmgr backend

Quoted 5 lines

vddc_dep_on_dal_pwrl is allocated and initialized in cz_hwmgr_backend_init Thus free the memory in cz_hwmgr_backend_fini

Change-Id Idd6dd4b76894579674bf334339b71df8559637fd

Series is:

Quoted 28 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +6 -0
index 7aa5ca8..0b74da3 100644
@@ -1224,6 +1224,12 @@ static int cz_hwmgr_backend_fini(struct
 pp_hwmgr *hwmgr)
 		phm_destroy_table(hwmgr, &(hwmgr-
 >disable_dynamic_state_management));
 		phm_destroy_table(hwmgr, &(hwmgr-
 >power_down_asic));
 		phm_destroy_table(hwmgr, &(hwmgr->setup_asic));
+
+		if (NULL != hwmgr->dyn_state.vddc_dep_on_dal_pwrl) {
+			kfree(hwmgr->dyn_state.vddc_dep_on_dal_pwrl);
+			hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL;
+		}
+
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +0 -1
 		kfree(hwmgr->backend);
 		hwmgr->backend = NULL;
 	}
--

2.7.4

Quoted 4 lines

_______________________________________________
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