Skip to contentSkip to conversation

drm/i915: Fix some NULL vs IS_ERR() conditions

PATCH In review Dan Carpenter 3 participants 4 messages Aug 7, 2019

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

PATCH 1/1 drm/i915: Fix some NULL vs IS_ERR() conditions

There were several places which check for NULL when they should have been checking for IS_ERR().

Fixes d8af05ff38ae ("drm/i915: Allow sharing the idle-barrier from other kernel requests")
---
 drivers/gpu/drm/i915/gt/selftest_context.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/gt/selftest_context.c +10 -10
index d39b5594cb02..6e7e9a6fd235 100644
@@ -86,8 +86,8 @@ static int __live_active_context(struct intel_engine_cs *engine,
 	}
 
 	ce = intel_context_create(fixme, engine);
-	if (!ce)
-		return -ENOMEM;
+	if (IS_ERR(ce))
+		return PTR_ERR(ce);
 
 	for (pass = 0; pass <= 2; pass++) {
 		struct i915_request *rq;
@@ -161,8 +161,8 @@ static int live_active_context(void *arg)
 	mutex_lock(&gt->i915->drm.struct_mutex);
 
 	fixme = live_context(gt->i915, file);
-	if (!fixme) {
-		err = -ENOMEM;
+	if (IS_ERR(fixme)) {
+		err = PTR_ERR(fixme);
 		goto unlock;
 	}
 
@@ -226,12 +226,12 @@ static int __live_remote_context(struct intel_engine_cs *engine,
 	 */
 
 	remote = intel_context_create(fixme, engine);
-	if (!remote)
-		return -ENOMEM;
+	if (IS_ERR(remote))
+		return PTR_ERR(remote);
 
 	local = intel_context_create(fixme, engine);
-	if (!local) {
-		err = -ENOMEM;
+	if (IS_ERR(local)) {
+		err = PTR_ERR(local);
 		goto err_remote;
 	}
 
@@ -274,8 +274,8 @@ static int live_remote_context(void *arg)
 	mutex_lock(&gt->i915->drm.struct_mutex);
 
 	fixme = live_context(gt->i915, file);
-	if (!fixme) {
-		err = -ENOMEM;
+	if (IS_ERR(fixme)) {
+		err = PTR_ERR(fixme);
 		goto unlock;
 	}
 
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Quoting Dan Carpenter (2019-08-07 13:28:32)

Quoted 5 lines

There were several places which check for NULL when they should have been checking for IS_ERR().

Fixes d8af05ff38ae ("drm/i915: Allow sharing the idle-barrier from other kernel requests")

Oops,

Thanks,
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

Quoting Chris Wilson (2019-08-07 13:32:15)

Quoted 9 lines

Quoting Dan Carpenter (2019-08-07 13:28:32)

Quoted 5 lines

There were several places which check for NULL when they should have been checking for IS_ERR().

Fixes d8af05ff38ae ("drm/i915: Allow sharing the idle-barrier from other kernel requests")

Oops,

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

#3 lore raw

✗ Fi.CI.BAT: failure for drm/i915: Fix some NULL vs IS_ERR() conditions

In reply to Dan Carpenter
== Series Details ==

== Series Details ==

Series: drm/i915: Fix some NULL vs IS_ERR() conditions
URL : https://patchwork.freedesktop.org/series/64834/
State : failure

== Summary ==

Applying: drm/i915: Fix some NULL vs IS_ERR() conditions Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/gt/selftest_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