All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Lespiau <damien.lespiau@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: yongjun_wei@trendmicro.com.cn
Subject: [PATCH] drm/i915: Don't check if a drm_file * is NULL in the ioctl code path
Date: Thu, 11 Jul 2013 19:31:34 +0100	[thread overview]
Message-ID: <1373567494-10632-1-git-send-email-damien.lespiau@intel.com> (raw)
In-Reply-To: <20130711182335.GD20291@strange.amr.corp.intel.com>

Right now code checkers point out that we try to dereference file before
testing it for NULL.

This check doesn't seem necessary as file needs to be valid for the
ioctl() code to run.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index ff47145..6573e47 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -318,9 +318,6 @@ i915_gem_context_get_hang_stats(struct intel_ring_buffer *ring,
 	if (ring->id != RCS)
 		return ERR_PTR(-EINVAL);
 
-	if (file == NULL)
-		return ERR_PTR(-EINVAL);
-
 	if (id == DEFAULT_CONTEXT_ID)
 		return &file_priv->hang_stats;
 
-- 
1.8.3.1

  reply	other threads:[~2013-07-11 18:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20  0:01 [PATCH -next] drm/i915: fix potential NULL pointer dereference in i915_gem_context_get_hang_stats() Wei Yongjun
2013-07-11 18:23 ` Damien Lespiau
2013-07-11 18:31   ` Damien Lespiau [this message]
2013-07-11 21:11     ` [PATCH] drm/i915: Don't check if a drm_file * is NULL in the ioctl code path 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=1373567494-10632-1-git-send-email-damien.lespiau@intel.com \
    --to=damien.lespiau@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=yongjun_wei@trendmicro.com.cn \
    /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.