]> err.no Git - linux-2.6/blobdiff - drivers/cpufreq/cpufreq.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
[linux-2.6] / drivers / cpufreq / cpufreq.c
index 86f0a24306246400d46694f3c38ad604fdd5df99..4e07d1f43a439577998a3c1124a06988970b1d2f 100644 (file)
@@ -625,7 +625,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy,
        unsigned int freq = 0;
        unsigned int ret;
 
-       if (!policy->governor->store_setspeed)
+       if (!policy->governor || !policy->governor->store_setspeed)
                return -EINVAL;
 
        ret = sscanf(buf, "%u", &freq);
@@ -639,7 +639,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy,
 
 static ssize_t show_scaling_setspeed(struct cpufreq_policy *policy, char *buf)
 {
-       if (!policy->governor->show_setspeed)
+       if (!policy->governor || !policy->governor->show_setspeed)
                return sprintf(buf, "<unsupported>\n");
 
        return policy->governor->show_setspeed(policy, buf);