linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: thermal: sysfs: lock tz when access sustainable power properties
@ 2016-06-02 14:47 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-06-02 14:47 UTC (permalink / raw)
  To: edubezval; +Cc: linux-pm

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-02 14:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-02 14:47 thermal: sysfs: lock tz when access sustainable power properties Dan Carpenter

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).