1
0
Fork 0

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>
steinar/wifi_calib_4_9_kernel
Giedrius Statkevičius 2016-04-16 03:01:57 +03:00 committed by Darren Hart
parent 2ce6d9932d
commit 19d46ee1ae
1 changed files with 2 additions and 3 deletions

View File

@ -948,11 +948,10 @@ static ssize_t sysfs_acpi_set(struct asus_laptop *asus,
const char *method) const char *method)
{ {
int rv, value; int rv, value;
int out = 0;
rv = parse_arg(buf, count, &value); rv = parse_arg(buf, count, &value);
if (rv > 0) if (rv <= 0)
out = value ? 1 : 0; return rv;
if (write_acpi_int(asus->handle, method, value)) if (write_acpi_int(asus->handle, method, value))
return -ENODEV; return -ENODEV;