drm/i915: return -ENOENT if the context doesn't exist
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 19 Jun 2012 14:52:31 +0000 (16:52 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 20 Jun 2012 09:16:08 +0000 (11:16 +0200)
This is our customary "no such object" errno, not -EINVAL.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_context.c

index 047f81c206b3a86103a52f598aba01fe51236adb..f775d861f05256e223d846666c52d4ef583344a1 100644 (file)
@@ -460,7 +460,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)
@@ -526,7 +526,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);