From: Rex Zhu Date: Sat, 29 Sep 2018 06:52:31 +0000 (+0800) Subject: drm/amd/pp: Fix memory leak on CI/AI X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3023015f791639838ec5d80e5c14851238a1a7d9;p=openwrt%2Fstaging%2Fblogic.git drm/amd/pp: Fix memory leak on CI/AI 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 Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c index 9d8fa2e39bad..e51d961a94b2 100644 --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c @@ -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; }