diff options
author | Monk Liu <Monk.Liu@amd.com> | 2016-05-30 16:05:58 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-06-09 10:49:10 -0400 |
commit | 9c55c5204445689c1d6b7b60e89de7f8fcf8a77f (patch) | |
tree | 3203863e8b67916b1dc829c3c56e819275a71ee8 /drivers/gpu | |
parent | 14d83e78c578a6c45163fb399ee760fe0d314bad (diff) | |
download | blackbird-op-linux-9c55c5204445689c1d6b7b60e89de7f8fcf8a77f.tar.gz blackbird-op-linux-9c55c5204445689c1d6b7b60e89de7f8fcf8a77f.zip |
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c index f6014b024f2a..b556bd0a8797 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c @@ -105,6 +105,15 @@ static void sdma_v2_4_init_golden_registers(struct amdgpu_device *adev) } } +static void sdma_v2_4_free_microcode(struct amdgpu_device *adev) +{ + int i; + for (i = 0; i < adev->sdma.num_instances; i++) { + release_firmware(adev->sdma.instance[i].fw); + adev->sdma.instance[i].fw = NULL; + } +} + /** * sdma_v2_4_init_microcode - load ucode images from disk * @@ -1018,6 +1027,7 @@ static int sdma_v2_4_sw_fini(void *handle) for (i = 0; i < adev->sdma.num_instances; i++) amdgpu_ring_fini(&adev->sdma.instance[i].ring); + sdma_v2_4_free_microcode(adev); return 0; } |