diff mbox series

drm/i915: Fix an error code in i915_gem_context_open()

Message ID 20190325092349.GF16023@kadam (mailing list archive)
State New, archived
Headers show
Series drm/i915: Fix an error code in i915_gem_context_open() | expand

Commit Message

Dan Carpenter March 25, 2019, 9:23 a.m. UTC
If gem_context_register() fails then "ctx" is a valid pointer, not an
error pointer.  We should just return "err".

Fixes: 3aa9945a528e ("drm/i915: Separate GEM context construction and registration to userspace")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chris Wilson March 25, 2019, 9:27 a.m. UTC | #1
Quoting Dan Carpenter (2019-03-25 09:23:49)
> If gem_context_register() fails then "ctx" is a valid pointer, not an
> error pointer.  We should just return "err".
> 
> Fixes: 3aa9945a528e ("drm/i915: Separate GEM context construction and registration to userspace")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_context.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index e6f594668245..25f267a03d3d 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -709,7 +709,7 @@ int i915_gem_context_open(struct drm_i915_private *i915,
>         idr_destroy(&file_priv->context_idr);
>         mutex_destroy(&file_priv->vm_idr_lock);
>         mutex_destroy(&file_priv->context_idr_lock);
> -       return PTR_ERR(ctx);
> +       return err;

I beat you by mere moments! Thanks for the patch, will be fixed
momentarily.
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index e6f594668245..25f267a03d3d 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -709,7 +709,7 @@  int i915_gem_context_open(struct drm_i915_private *i915,
 	idr_destroy(&file_priv->context_idr);
 	mutex_destroy(&file_priv->vm_idr_lock);
 	mutex_destroy(&file_priv->context_idr_lock);
-	return PTR_ERR(ctx);
+	return err;
 }
 
 void i915_gem_context_close(struct drm_file *file)