summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorGiedrius Statkevičius <giedrius.statkevicius@gmail.com>2016-04-16 03:01:57 +0300
committerDarren Hart <dvhart@linux.intel.com>2016-04-25 10:42:54 -0700
commit19d46ee1aec06de3dc1137c76c29e07bfd96d99d (patch)
treeed8a6c84e7579746ad2ba7fe539d8719ecfd443a /drivers/platform
parent2ce6d9932db55cfc09dd6362d6d0d47a361f5f02 (diff)
downloadlwn-19d46ee1aec06de3dc1137c76c29e07bfd96d99d.tar.gz
lwn-19d46ee1aec06de3dc1137c76c29e07bfd96d99d.zip
asus-laptop: correct error handling in sysfs_acpi_set
Properly return rv back to the caller in the case of an error in parse_arg. In the process remove a unused variable 'out'. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/asus-laptop.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index 223090c9d433..15f131146501 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -948,11 +948,10 @@ static ssize_t sysfs_acpi_set(struct asus_laptop *asus,
const char *method)
{
int rv, value;
- int out = 0;
rv = parse_arg(buf, count, &value);
- if (rv > 0)
- out = value ? 1 : 0;
+ if (rv <= 0)
+ return rv;
if (write_acpi_int(asus->handle, method, value))
return -ENODEV;