From: Dan Carpenter <error27@gmail.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [patch] i915: fix impossible BUG_ON() test
Date: Wed, 27 Oct 2010 21:25:34 +0000 [thread overview]
Message-ID: <20101027212534.GM6062@bicker> (raw)
obj_priv->pin_count is unsigned so the BUG_ON(obj_priv->pin_count < 0)
will never trigger.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 8eb8453..151d9c8 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4082,10 +4082,11 @@ i915_gem_object_unpin(struct drm_gem_object *obj)
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
WARN_ON(i915_verify_lists(dev));
- obj_priv->pin_count--;
- BUG_ON(obj_priv->pin_count < 0);
+ BUG_ON(obj_priv->pin_count = 0);
BUG_ON(obj_priv->gtt_space = NULL);
+ obj_priv->pin_count--;
+
/* If the object is no longer pinned, and is
* neither active nor being flushed, then stick it on
* the inactive list
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [patch] i915: fix impossible BUG_ON() test
Date: Wed, 27 Oct 2010 23:25:34 +0200 [thread overview]
Message-ID: <20101027212534.GM6062@bicker> (raw)
obj_priv->pin_count is unsigned so the BUG_ON(obj_priv->pin_count < 0)
will never trigger.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 8eb8453..151d9c8 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4082,10 +4082,11 @@ i915_gem_object_unpin(struct drm_gem_object *obj)
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
WARN_ON(i915_verify_lists(dev));
- obj_priv->pin_count--;
- BUG_ON(obj_priv->pin_count < 0);
+ BUG_ON(obj_priv->pin_count == 0);
BUG_ON(obj_priv->gtt_space == NULL);
+ obj_priv->pin_count--;
+
/* If the object is no longer pinned, and is
* neither active nor being flushed, then stick it on
* the inactive list
next reply other threads:[~2010-10-27 21:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-27 21:25 Dan Carpenter [this message]
2010-10-27 21:25 ` [patch] i915: fix impossible BUG_ON() test Dan Carpenter
2010-10-27 21:30 ` Chris Wilson
2010-10-27 21:30 ` Chris Wilson
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=20101027212534.GM6062@bicker \
--to=error27@gmail.com \
--cc=chris@chris-wilson.co.uk \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
/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.