提交 05f19eb5 编写于 作者: M Monk Liu 提交者: Alex Deucher

drm/amdgpu: fix uvd fini mem leak

Signed-off-by: NMonk Liu <Monk.Liu@amd.com>
Reviewed-by: NChristian König <christian.koenig@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 e517cd77
...@@ -253,19 +253,20 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev) ...@@ -253,19 +253,20 @@ 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);
r = amdgpu_bo_reserve(adev->uvd.vcpu_bo, false); if (adev->uvd.vcpu_bo) {
if (!r) { r = amdgpu_bo_reserve(adev->uvd.vcpu_bo, false);
amdgpu_bo_kunmap(adev->uvd.vcpu_bo); if (!r) {
amdgpu_bo_unpin(adev->uvd.vcpu_bo); amdgpu_bo_kunmap(adev->uvd.vcpu_bo);
amdgpu_bo_unreserve(adev->uvd.vcpu_bo); amdgpu_bo_unpin(adev->uvd.vcpu_bo);
} amdgpu_bo_unreserve(adev->uvd.vcpu_bo);
}
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册