summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-11-11 01:18:16 +0300
committerDarren Hart <dvhart@linux.intel.com>2015-11-11 09:22:15 +0300
commitb82983401684ba06fcf3fbafa63edf371c0d4775 (patch)
tree61a6b69cbd5a8c9c4b30ad8b93230d8400435ec0 /drivers/platform
parentf71c882dd4cfe4aa88ea07b1402ddd43605d4aef (diff)
downloadlinux-b82983401684ba06fcf3fbafa63edf371c0d4775.tar.xz
asus-wmi: fix error handling in store_sys_wmi()
The asus_wmi_get_devstate_simple() returns 0-1 on success. In theory according to static checkers, it can return either -EIO or -ENODEV on failure. Currently the error handling code only handles -ENODEV and -EIO is treated as success. Let's make it handle the -EIO error as well. It's possible that it can't actually return -EIO and this patch is not needed but in that case this patch is harmless and silences a static checker warning so it's still worth it. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/asus-wmi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 1f7d80ff8cb4..179eeee227b4 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1682,7 +1682,7 @@ static ssize_t store_sys_wmi(struct asus_wmi *asus, int devid,
int rv, err, value;
value = asus_wmi_get_devstate_simple(asus, devid);
- if (value == -ENODEV) /* Check device presence */
+ if (value < 0)
return value;
rv = parse_arg(buf, count, &value);