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

drm/amdgpu: fix sdma24 ucode mem leak

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
9c55c520 14d83e78

+10
+10
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
··· 105 105 } 106 106 } 107 107 108 + static void sdma_v2_4_free_microcode(struct amdgpu_device *adev) 109 + { 110 + int i; 111 + for (i = 0; i < adev->sdma.num_instances; i++) { 112 + release_firmware(adev->sdma.instance[i].fw); 113 + adev->sdma.instance[i].fw = NULL; 114 + } 115 + } 116 + 108 117 /** 109 118 * sdma_v2_4_init_microcode - load ucode images from disk 110 119 * ··· 1027 1018 for (i = 0; i < adev->sdma.num_instances; i++) 1028 1019 amdgpu_ring_fini(&adev->sdma.instance[i].ring); 1029 1020 1021 + sdma_v2_4_free_microcode(adev); 1030 1022 return 0; 1031 1023 } 1032 1024