intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: mika.kuoppala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: drm/i915: add i915_gem_context_get_hang_stats()
Date: Wed, 19 Jun 2013 18:02:34 +0300	[thread overview]
Message-ID: <20130619150234.GA28257@elgon.mountain> (raw)

Hello Mika Kuoppala,

This is a semi-automatic email about new static checker warnings.

The patch c0bb617a70c9: "drm/i915: add
i915_gem_context_get_hang_stats()" from Jun 12, 2013, leads to the
following Smatch complaint:

drivers/gpu/drm/i915/i915_gem_context.c:321 i915_gem_context_get_hang_stats()
	 warn: variable dereferenced before check 'file' (see line 312)

drivers/gpu/drm/i915/i915_gem_context.c
   311		struct drm_i915_private *dev_priv = ring->dev->dev_private;
   312		struct drm_i915_file_private *file_priv = file->driver_priv;
                                                          ^^^^^^^^^^^^^^^^^
New dereference.

   313		struct i915_hw_context *to;
   314	
   315		if (dev_priv->hw_contexts_disabled)
   316			return ERR_PTR(-ENOENT);
   317	
   318		if (ring->id != RCS)
   319			return ERR_PTR(-EINVAL);
   320	
   321		if (file == NULL)
                    ^^^^^^^^^^^^
New check.

   322			return ERR_PTR(-EINVAL);
   323	

regards,
dan carpenter

                 reply	other threads:[~2013-06-19 15:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20130619150234.GA28257@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).