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

drm/amdgpu: fix cik sdma ucode memleak

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Monk Liu and committed by
Alex Deucher
d1ff53b7 9c55c520

+11
+11
drivers/gpu/drm/amd/amdgpu/cik_sdma.c
··· 66 66 67 67 u32 amdgpu_cik_gpu_check_soft_reset(struct amdgpu_device *adev); 68 68 69 + 70 + static void cik_sdma_free_microcode(struct amdgpu_device *adev) 71 + { 72 + int i; 73 + for (i = 0; i < adev->sdma.num_instances; i++) { 74 + release_firmware(adev->sdma.instance[i].fw); 75 + adev->sdma.instance[i].fw = NULL; 76 + } 77 + } 78 + 69 79 /* 70 80 * sDMA - System DMA 71 81 * Starting with CIK, the GPU has new asynchronous ··· 1015 1005 for (i = 0; i < adev->sdma.num_instances; i++) 1016 1006 amdgpu_ring_fini(&adev->sdma.instance[i].ring); 1017 1007 1008 + cik_sdma_free_microcode(adev); 1018 1009 return 0; 1019 1010 } 1020 1011