]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/amd/powerplay: not free hwmgr/smumgr in asic private functions.
authorRex Zhu <Rex.Zhu@amd.com>
Mon, 2 Jan 2017 10:37:36 +0000 (18:37 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 27 Jan 2017 16:12:59 +0000 (11:12 -0500)
struct smumgr/hwmgr will be freed on amd_powerplay_destory

and if we free them in one of asic private functions, other private
date may not be freed. for example: power state and power table
in hwmgr.

Signed-off-by: Rex Zhu <Rex.Zhu@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/cz_hwmgr.c
drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c

index f4ff236af96a00857c3b44358d55c2b31523d37e..14701772bec6234d2ac2cd8b8e54897747ae6606 100644 (file)
@@ -1217,10 +1217,9 @@ static int cz_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
 
 static int cz_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
 {
-       if (hwmgr != NULL && hwmgr->backend != NULL) {
+       if (hwmgr != NULL && hwmgr->backend != NULL)
                kfree(hwmgr->backend);
-               kfree(hwmgr);
-       }
+
        return 0;
 }
 
index 1f5148e1f3dea15f19e3ce6b2d3282af8ac786b3..2d4cf2c77c4084632a9c96c444ce8a1f9b6b8893 100644 (file)
@@ -831,7 +831,6 @@ static int cz_smu_fini(struct pp_smumgr *smumgr)
                cgs_free_gpu_mem(smumgr->device,
                                cz_smu->smu_buffer.handle);
                kfree(cz_smu);
-               kfree(smumgr);
        }
 
        return 0;