Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c2327be authored by Christian König's avatar Christian König Committed by Alex Deucher
Browse files

drm/amdgpu: stop context leak in the error path

parent 76a1ea61
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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);