All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
	David Airlie <airlied@linux.ie>,
	intel-gfx@lists.freedesktop.org, kernel-janitors@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH] drm/i915: Fix some NULL vs IS_ERR() conditions
Date: Wed, 07 Aug 2019 12:28:32 +0000	[thread overview]
Message-ID: <20190807122832.GA10517@mwanda> (raw)

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

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
	David Airlie <airlied@linux.ie>,
	intel-gfx@lists.freedesktop.org, kernel-janitors@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH] drm/i915: Fix some NULL vs IS_ERR() conditions
Date: Wed, 7 Aug 2019 15:28:32 +0300	[thread overview]
Message-ID: <20190807122832.GA10517@mwanda> (raw)

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

             reply	other threads:[~2019-08-07 12:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07 12:28 Dan Carpenter [this message]
2019-08-07 12:28 ` [PATCH] drm/i915: Fix some NULL vs IS_ERR() conditions 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190807122832.GA10517@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=airlied@linux.ie \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=tvrtko.ursulin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.