diff options
-rw-r--r-- | drivers/cpufreq/cpufreq_interactive.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c index e87942831186..44e97a6816a9 100644 --- a/drivers/cpufreq/cpufreq_interactive.c +++ b/drivers/cpufreq/cpufreq_interactive.c @@ -494,7 +494,9 @@ static ssize_t show_boost_factor(struct kobject *kobj, static ssize_t store_boost_factor(struct kobject *kobj, struct attribute *attr, const char *buf, size_t count) { - return strict_strtoul(buf, 0, &boost_factor); + if (!strict_strtoul(buf, 0, &boost_factor)) + return count; + return -EINVAL; } static struct global_attr boost_factor_attr = __ATTR(boost_factor, 0644, @@ -509,7 +511,9 @@ static ssize_t show_max_boost(struct kobject *kobj, static ssize_t store_max_boost(struct kobject *kobj, struct attribute *attr, const char *buf, size_t count) { - return strict_strtoul(buf, 0, &max_boost); + if (!strict_strtoul(buf, 0, &max_boost)) + return count; + return -EINVAL; } static struct global_attr max_boost_attr = __ATTR(max_boost, 0644, @@ -525,7 +529,9 @@ static ssize_t show_sustain_load(struct kobject *kobj, static ssize_t store_sustain_load(struct kobject *kobj, struct attribute *attr, const char *buf, size_t count) { - return strict_strtoul(buf, 0, &sustain_load); + if (!strict_strtoul(buf, 0, &sustain_load)) + return count; + return -EINVAL; } static struct global_attr sustain_load_attr = __ATTR(sustain_load, 0644, |