linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] PM / devfreq: Fix available_governor sysfs
@ 2017-02-07 12:16 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-02-07 12:16 UTC (permalink / raw)
  To: cw00.choi; +Cc: linux-pm

Hello Chanwoo Choi,

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

The patch bcf23c79c4e4: "PM / devfreq: Fix available_governor sysfs" 
from Jan 31, 2017, leads to the following Smatch complaint:

drivers/devfreq/devfreq.c:940 governor_store()
	 warn: variable dereferenced before check 'df->governor' (see line 935)

drivers/devfreq/devfreq.c
   934			goto out;
   935		} else if (df->governor->immutable || governor->immutable) {
                           ^^^^^^^^^^^^
Patch introduces a new dereference.

   936			ret = -EINVAL;
   937			goto out;
   938		}
   939	
   940		if (df->governor) {
                    ^^^^^^^^^^^^
Existing code assumes "df->governor" can be NULL.

   941			ret = df->governor->event_handler(df, DEVFREQ_GOV_STOP, NULL);
   942			if (ret) {

regards,
dan carpenter

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

only message in thread, other threads:[~2017-02-07 12:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-07 12:16 [bug report] PM / devfreq: Fix available_governor sysfs 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).