drm/i915: return -ENOENT if the context doesn't exist
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>
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 047f81c..f775d86 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -460,7 +460,7 @@
} 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 @@
ctx = i915_gem_context_get(file_priv, args->ctx_id);
if (!ctx) {
mutex_unlock(&dev->struct_mutex);
- return -EINVAL;
+ return -ENOENT;
}
do_destroy(ctx);