drm/amd/pp: Fix memory leak on CI/AI
authorRex Zhu <Rex.Zhu@amd.com>
Sat, 29 Sep 2018 06:52:31 +0000 (14:52 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Oct 2018 22:05:25 +0000 (17:05 -0500)
On CI/AI, fw was not loaded by smu, but
smu's fw still need to be released
when driver fini.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amd_powerplay.c

index 9d8fa2e39bad0509302b2590eda0fdc720bbedef..e51d961a94b203539a32bad0e8fe95ba5dcf651f 100644 (file)
@@ -109,11 +109,11 @@ static int pp_sw_fini(void *handle)
 
        hwmgr_sw_fini(hwmgr);
 
-       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU) {
-               release_firmware(adev->pm.fw);
-               adev->pm.fw = NULL;
+       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)
                amdgpu_ucode_fini_bo(adev);
-       }
+
+       release_firmware(adev->pm.fw);
+       adev->pm.fw = NULL;
 
        return 0;
 }