Skip to contentSkip to conversation

asus-laptop: fix incorrect return value for write_acpi_int_ret if handle is NULL

PATCH New Axel Lin 1 participant 1 message Jul 8, 2010

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 asus-laptop: fix incorrect return value for write_acpi_int_ret if handle is NULL

According to the comments of write_acpi_int_ret(), write_acpi_int_ret() should return 0 if write is successful, -1 else. Thus if handle is NULL, the write does not happen, it should return -1.

---
 drivers/platform/x86/asus-laptop.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/platform/x86/asus-laptop.c +1 -1
index 71db2ef..93487eb 100644
@@ -297,7 +297,7 @@ static int write_acpi_int_ret(acpi_handle handle, const char *method, int val,
 	acpi_status status;
 
 	if (!handle)
-		return 0;
+		return -1;
 
 	params.count = 1;
 	params.pointer = &in_obj;
Signature · 1 line
1.5.4.3