]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/amd/powerplay: fix memory leak in rv_hwmgr backend
authorHawking Zhang <Hawking.Zhang@amd.com>
Tue, 6 Jun 2017 08:19:34 +0000 (16:19 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 6 Jun 2017 21:01:05 +0000 (17:01 -0400)
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

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c

index 9b431511d274a2ee57dbee9f8f90bbcd640ea28f..4c7f430b36eba81ab13d76932bcabec2b5e50ff7 100644 (file)
@@ -656,6 +656,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;