Skip to contentSkip to conversation

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

PATCH In review Dan Carpenter 3 participants 3 messages Mar 25, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

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")
---
 drivers/gpu/drm/i915/i915_gem_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_context.c +1 -1
index e6f594668245..25f267a03d3d 100644
@@ -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)
Signature · 6 lines
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

Quoting Dan Carpenter (2019-03-25 09:23:49)

Quoted 14 lines

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")
---
 drivers/gpu/drm/i915/i915_gem_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_context.c +0 -0
index e6f594668245..25f267a03d3d 100644

drivers/gpu/drm/i915/i915_gem_context.c int i915_gem_context_open(struct drm_i915_private *i915, · line 712

Quoted 5 lines
drivers/gpu/drm/i915/i915_gem_context.c +1 -1
@@ -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
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✗ Fi.CI.BAT: failure for drm/i915: Fix an error code in i915_gem_context_open()

In reply to Dan Carpenter
== Series Details ==

== Series Details ==

Series: drm/i915: Fix an error code in i915_gem_context_open()
URL : https://patchwork.freedesktop.org/series/58518/
State : failure

== Summary ==

Applying: drm/i915: Fix an error code in i915_gem_context_open() Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/i915_gem_context.c
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx