mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-17 20:29:24 +00:00
drm/amdgpu: fix uvd fini 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>
This commit is contained in:
parent
e517cd77ee
commit
05f19eb5bd
1 changed files with 10 additions and 9 deletions
|
@ -253,11 +253,11 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (adev->uvd.vcpu_bo == NULL)
|
kfree(adev->uvd.saved_bo);
|
||||||
return 0;
|
|
||||||
|
|
||||||
amd_sched_entity_fini(&adev->uvd.ring.sched, &adev->uvd.entity);
|
amd_sched_entity_fini(&adev->uvd.ring.sched, &adev->uvd.entity);
|
||||||
|
|
||||||
|
if (adev->uvd.vcpu_bo) {
|
||||||
r = amdgpu_bo_reserve(adev->uvd.vcpu_bo, false);
|
r = amdgpu_bo_reserve(adev->uvd.vcpu_bo, false);
|
||||||
if (!r) {
|
if (!r) {
|
||||||
amdgpu_bo_kunmap(adev->uvd.vcpu_bo);
|
amdgpu_bo_kunmap(adev->uvd.vcpu_bo);
|
||||||
|
@ -266,6 +266,7 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)
|
||||||
}
|
}
|
||||||
|
|
||||||
amdgpu_bo_unref(&adev->uvd.vcpu_bo);
|
amdgpu_bo_unref(&adev->uvd.vcpu_bo);
|
||||||
|
}
|
||||||
|
|
||||||
amdgpu_ring_fini(&adev->uvd.ring);
|
amdgpu_ring_fini(&adev->uvd.ring);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue