diff options
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index cc3baf10d2d0..1d41496ed2f8 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -625,7 +625,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy, | |||
625 | unsigned int freq = 0; | 625 | unsigned int freq = 0; |
626 | unsigned int ret; | 626 | unsigned int ret; |
627 | 627 | ||
628 | if (!policy->governor->store_setspeed) | 628 | if (!policy->governor || !policy->governor->store_setspeed) |
629 | return -EINVAL; | 629 | return -EINVAL; |
630 | 630 | ||
631 | ret = sscanf(buf, "%u", &freq); | 631 | ret = sscanf(buf, "%u", &freq); |
@@ -639,7 +639,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy, | |||
639 | 639 | ||
640 | static ssize_t show_scaling_setspeed(struct cpufreq_policy *policy, char *buf) | 640 | static ssize_t show_scaling_setspeed(struct cpufreq_policy *policy, char *buf) |
641 | { | 641 | { |
642 | if (!policy->governor->show_setspeed) | 642 | if (!policy->governor || !policy->governor->show_setspeed) |
643 | return sprintf(buf, "<unsupported>\n"); | 643 | return sprintf(buf, "<unsupported>\n"); |
644 | 644 | ||
645 | return policy->governor->show_setspeed(policy, buf); | 645 | return policy->governor->show_setspeed(policy, buf); |