linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: edubezval@gmail.com
Cc: linux-pm@vger.kernel.org
Subject: re: thermal: sysfs: lock tz when access sustainable power properties
Date: Thu, 2 Jun 2016 17:47:00 +0300	[thread overview]
Message-ID: <20160602144700.GA19095@mwanda> (raw)

Hello Eduardo Valentin,

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

The patch 58601ec845aa: "thermal: sysfs: lock tz when access 
sustainable power properties" from May 30, 2016, leads to the 
following Smatch complaint:

drivers/thermal/thermal_sysfs.c:376 sustainable_power_show()
	 warn: variable dereferenced before check 'tz->tzp' (see line 373)

drivers/thermal/thermal_sysfs.c
   372		mutex_lock(&tz->lock);
   373		sustainable_power = tz->tzp->sustainable_power;
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
New dereference.

   374		mutex_unlock(&tz->lock);
   375	
   376		if (tz->tzp)
                    ^^^^^^^
Old code assumed this could be NULL.

   377			return sprintf(buf, "%u\n", sustainable_power);
   378		else

regards,
dan carpenter

                 reply	other threads:[~2016-06-02 14:47 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=20160602144700.GA19095@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=edubezval@gmail.com \
    --cc=linux-pm@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 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).