From 08580dde93cd93de07f8124c59fc3c8300f3e4ed Mon Sep 17 00:00:00 2001 From: Peter Boonstoppel Date: Tue, 6 Dec 2011 16:59:30 -0800 Subject: cpufreq interactive governor: Fix attribute write bug Attribute store functions used to return 0 upon success, but should return count instead. Change-Id: I2ab15e536d9affbf80bbcb2e557c6d217d5a9dfa Signed-off-by: Peter Boonstoppel Reviewed-on: http://git-master/r/68554 Reviewed-by: Aleksandr Frid Tested-by: Daniel Solomon Reviewed-by: Diwakar Tundlam --- drivers/cpufreq/cpufreq_interactive.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'drivers/cpufreq') 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, -- cgit v1.2.3