[Intel-gfx] [PATCH 3/4] drm/i915: return -ENOENT if the context doesn't exist
Ben Widawsky
ben at bwidawsk.net
Tue Jun 19 18:19:11 CEST 2012
On Tue, 19 Jun 2012 16:52:31 +0200
Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> This is our customary "no such object" errno, not -EINVAL.
>
> Signed-Off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
You've missed idr_cleanup for this. That doesn't get back down to
userspace, but it keeps things consistent.
With that, this is
Reviewed-by: Ben Widawsky <ben at bwidawsk.net>
> ---
> drivers/gpu/drm/i915/i915_gem_context.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index 671927a..3d8ae6c 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -455,7 +455,7 @@ int i915_switch_context(struct intel_ring_buffer *ring,
> } else {
> to = i915_gem_context_get(file_priv, to_id);
> if (to == NULL)
> - return -EINVAL;
> + return -ENOENT;
> }
>
> if (from_obj == to->obj)
> @@ -521,7 +521,7 @@ int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
> ctx = i915_gem_context_get(file_priv, args->ctx_id);
> if (!ctx) {
> mutex_unlock(&dev->struct_mutex);
> - return -EINVAL;
> + return -ENOENT;
> }
>
> do_destroy(ctx);
--
Ben Widawsky, Intel Open Source Technology Center
More information about the Intel-gfx
mailing list