Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: fix fw leak in non-powerplay dpm code

We need to release the firmware on driver tear down.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

+18
+3
drivers/gpu/drm/amd/amdgpu/ci_dpm.c
··· 6221 6221 ci_dpm_fini(adev); 6222 6222 mutex_unlock(&adev->pm.mutex); 6223 6223 6224 + release_firmware(adev->pm.fw); 6225 + adev->pm.fw = NULL; 6226 + 6224 6227 return 0; 6225 6228 } 6226 6229
+5
drivers/gpu/drm/amd/amdgpu/fiji_dpm.c
··· 72 72 73 73 static int fiji_dpm_sw_fini(void *handle) 74 74 { 75 + struct amdgpu_device *adev = (struct amdgpu_device *)handle; 76 + 77 + release_firmware(adev->pm.fw); 78 + adev->pm.fw = NULL; 79 + 75 80 return 0; 76 81 } 77 82
+5
drivers/gpu/drm/amd/amdgpu/iceland_dpm.c
··· 72 72 73 73 static int iceland_dpm_sw_fini(void *handle) 74 74 { 75 + struct amdgpu_device *adev = (struct amdgpu_device *)handle; 76 + 77 + release_firmware(adev->pm.fw); 78 + adev->pm.fw = NULL; 79 + 75 80 return 0; 76 81 } 77 82
+5
drivers/gpu/drm/amd/amdgpu/tonga_dpm.c
··· 71 71 72 72 static int tonga_dpm_sw_fini(void *handle) 73 73 { 74 + struct amdgpu_device *adev = (struct amdgpu_device *)handle; 75 + 76 + release_firmware(adev->pm.fw); 77 + adev->pm.fw = NULL; 78 + 74 79 return 0; 75 80 } 76 81