All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fix some NULL vs IS_ERR() conditions
@ 2019-08-07 12:28 ` Dan Carpenter
  0 siblings, 0 replies; 7+ messages in thread
From: Dan Carpenter @ 2019-08-07 12:28 UTC (permalink / raw)
  To: Jani Nikula, Chris Wilson
  Cc: Tvrtko Ursulin, David Airlie, intel-gfx, kernel-janitors,
	dri-devel, Rodrigo Vivi

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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/gt/selftest_context.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/selftest_context.c b/drivers/gpu/drm/i915/gt/selftest_context.c
index d39b5594cb02..6e7e9a6fd235 100644
--- a/drivers/gpu/drm/i915/gt/selftest_context.c
+++ b/drivers/gpu/drm/i915/gt/selftest_context.c
@@ -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;
 	}
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] drm/i915: Fix some NULL vs IS_ERR() conditions
@ 2019-08-07 12:28 ` Dan Carpenter
  0 siblings, 0 replies; 7+ messages in thread
From: Dan Carpenter @ 2019-08-07 12:28 UTC (permalink / raw)
  To: Jani Nikula, Chris Wilson
  Cc: Tvrtko Ursulin, David Airlie, intel-gfx, kernel-janitors,
	dri-devel, Rodrigo Vivi

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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/gt/selftest_context.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/selftest_context.c b/drivers/gpu/drm/i915/gt/selftest_context.c
index d39b5594cb02..6e7e9a6fd235 100644
--- a/drivers/gpu/drm/i915/gt/selftest_context.c
+++ b/drivers/gpu/drm/i915/gt/selftest_context.c
@@ -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;
 	}
 
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: Fix some NULL vs IS_ERR() conditions
  2019-08-07 12:28 ` Dan Carpenter
@ 2019-08-07 12:32   ` Chris Wilson
  -1 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2019-08-07 12:32 UTC (permalink / raw)
  To: Dan Carpenter, Jani Nikula
  Cc: Tvrtko Ursulin, David Airlie, intel-gfx, kernel-janitors,
	dri-devel, Rodrigo Vivi

Quoting Dan Carpenter (2019-08-07 13:28:32)
> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Oops,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Thanks,
-Chris

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: Fix some NULL vs IS_ERR() conditions
@ 2019-08-07 12:32   ` Chris Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2019-08-07 12:32 UTC (permalink / raw)
  To: Dan Carpenter, Jani Nikula
  Cc: Tvrtko Ursulin, David Airlie, intel-gfx, kernel-janitors,
	dri-devel, Rodrigo Vivi

Quoting Dan Carpenter (2019-08-07 13:28:32)
> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Oops,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Thanks,
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: Fix some NULL vs IS_ERR() conditions
  2019-08-07 12:32   ` Chris Wilson
@ 2019-08-07 13:35     ` Chris Wilson
  -1 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2019-08-07 13:35 UTC (permalink / raw)
  To: Dan Carpenter, Jani Nikula
  Cc: David Airlie, intel-gfx, kernel-janitors, dri-devel

Quoting Chris Wilson (2019-08-07 13:32:15)
> Quoting Dan Carpenter (2019-08-07 13:28:32)
> > 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")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Oops,
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

And pushed, ta.
-Chris

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: Fix some NULL vs IS_ERR() conditions
@ 2019-08-07 13:35     ` Chris Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2019-08-07 13:35 UTC (permalink / raw)
  To: Dan Carpenter, Jani Nikula
  Cc: David Airlie, intel-gfx, kernel-janitors, dri-devel

Quoting Chris Wilson (2019-08-07 13:32:15)
> Quoting Dan Carpenter (2019-08-07 13:28:32)
> > 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")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Oops,
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ✗ Fi.CI.BAT: failure for drm/i915: Fix some NULL vs IS_ERR() conditions
  2019-08-07 12:28 ` Dan Carpenter
  (?)
  (?)
@ 2019-08-07 14:01 ` Patchwork
  -1 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2019-08-07 14:01 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: intel-gfx

== 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-07 14:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-07 12:28 [PATCH] drm/i915: Fix some NULL vs IS_ERR() conditions Dan Carpenter
2019-08-07 12:28 ` Dan Carpenter
2019-08-07 12:32 ` Chris Wilson
2019-08-07 12:32   ` Chris Wilson
2019-08-07 13:35   ` Chris Wilson
2019-08-07 13:35     ` Chris Wilson
2019-08-07 14:01 ` ✗ Fi.CI.BAT: failure for " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.