Skip to content

Commit

Permalink
drm/amdgpu: stop context leak in the error path
Browse files Browse the repository at this point in the history
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
  • Loading branch information
Christian König authored and Alex Deucher committed Jul 16, 2015
1 parent 76a1ea6 commit 5c2327b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,12 +817,16 @@ int amdgpu_cs_wait_ioctl(struct drm_device *dev, void *data,

r = amdgpu_cs_get_ring(adev, wait->in.ip_type, wait->in.ip_instance,
wait->in.ring, &ring);
if (r)
if (r) {
amdgpu_ctx_put(ctx);
return r;
}

r = amdgpu_fence_recreate(ring, filp, wait->in.handle, &fence);
if (r)
if (r) {
amdgpu_ctx_put(ctx);
return r;
}

r = fence_wait_timeout(&fence->base, true, timeout);
amdgpu_fence_unref(&fence);
Expand Down

0 comments on commit 5c2327b

Please sign in to comment.