All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namrta Salonie <namrta.salonie@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 4/4] drm/i915: Fix potential NULL pointer de-reference in ggtt unbind.
Date: Thu, 19 Nov 2015 16:57:31 +0530	[thread overview]
Message-ID: <1447932451-9787-5-git-send-email-namrta.salonie@intel.com> (raw)
In-Reply-To: <1447932451-9787-1-git-send-email-namrta.salonie@intel.com>

    Found by static analysis tool.

Signed-off-by: Namrta Salonie <namrta.salonie@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 8afda45..705b1e6 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -3097,7 +3097,10 @@ i915_gem_obj_ggtt_pin(struct drm_i915_gem_object *obj,
 static inline int
 i915_gem_object_ggtt_unbind(struct drm_i915_gem_object *obj)
 {
-	return i915_vma_unbind(i915_gem_obj_to_ggtt(obj));
+	struct i915_vma *vma = i915_gem_obj_to_ggtt(obj);
+	if (!vma)
+		return -EINVAL;
+	return i915_vma_unbind(vma);
 }
 
 void i915_gem_object_ggtt_unpin_view(struct drm_i915_gem_object *obj,
-- 
1.7.9.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-11-19 11:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 11:27 [PATCH 0/4] Fix issues reported by static code analysis tool Namrta Salonie
2015-11-19 11:27 ` [PATCH 1/4] drm/i915: Fix for potential NULL pointer dereference at ctx access Namrta Salonie
2015-11-19 11:40   ` Chris Wilson
2015-11-19 11:27 ` [PATCH 2/4] drm/i915: Fix possible null dereference in two debugfs functions Namrta Salonie
2015-11-19 11:37   ` Chris Wilson
2015-11-26 11:02     ` [PATCH] drm/i915: Fix possible null dereference in framebuffer_info debugfs function Namrta Salonie
2015-11-26 12:43       ` Chris Wilson
2015-11-26 14:38         ` Daniel Vetter
2015-11-27  8:13         ` Namrta Salonie
2015-11-30  8:14           ` Daniel Vetter
2015-11-19 11:27 ` [PATCH 3/4] drm/i915 : Fix to remove unnecsessary checks in postclose function Namrta Salonie
2015-11-19 15:32   ` Daniel Vetter
2015-11-19 11:27 ` Namrta Salonie [this message]
2015-11-19 11:39   ` [PATCH 4/4] drm/i915: Fix potential NULL pointer de-reference in ggtt unbind 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=1447932451-9787-5-git-send-email-namrta.salonie@intel.com \
    --to=namrta.salonie@intel.com \
    --cc=intel-gfx@lists.freedesktop.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.