From: Corentin Chary Date: Fri, 1 Jul 2011 09:34:38 +0000 (+0200) Subject: asus-wmi: return proper value in store_cpufv() X-Git-Tag: next-20110726~12^2~12 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7d753636e6eb0245fd9b65d8666fc79373fe1a84;p=karo-tx-linux.git asus-wmi: return proper value in store_cpufv() Cc: stable@kernel.org Signed-off-by: Corentin Chary Signed-off-by: Matthew Garrett --- diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 94509ba11b3d..e4ea7dae9bec 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -1307,14 +1307,18 @@ ASUS_WMI_CREATE_DEVICE_ATTR(cardr, 0644, ASUS_WMI_DEVID_CARDREADER); static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - int value; + int value, rv; if (!count || sscanf(buf, "%i", &value) != 1) return -EINVAL; if (value < 0 || value > 2) return -EINVAL; - return asus_wmi_evaluate_method(ASUS_WMI_METHODID_CFVS, value, 0, NULL); + rv = asus_wmi_evaluate_method(ASUS_WMI_METHODID_CFVS, value, 0, NULL); + if (rv < 0) + return rv; + + return count; } static DEVICE_ATTR(cpufv, S_IRUGO | S_IWUSR, NULL, store_cpufv);