[bug report] PM / devfreq: Fix available_governor sysfs

From: Dan Carpenter <hidden>
Date: 2017-02-07 12:17:03

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help