提交 19d46ee1 编写于 作者: G Giedrius Statkevičius 提交者: Darren Hart

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: NGiedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
上级 2ce6d993
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部