Skip to contentSkip to conversation

ACPI button: don't try to use a non-existent lid device

PATCH Applied Jesse Barnes 2 participants 2 messages Oct 7, 2009 – Oct 13, 2009 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI button: don't try to use a non-existent lid device

If a call comes in to check the lid state but there's no lid device present, we should return -ENODEV.

---
 drivers/acpi/button.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/acpi/button.c +3 -0
index 9335b87..0c9c6a9 100644
@@ -251,6 +251,9 @@ int acpi_lid_open(void)
 	acpi_status status;
 	unsigned long long state;
 
+	if (!lid_device)
+		return -ENODEV;
+
 	status = acpi_evaluate_integer(lid_device->handle, "_LID", NULL,
 				       &state);
 	if (ACPI_FAILURE(status))
Signature · 1 line
1.6.3.3
reviewer Applied
#1 lore raw

applied

thanks,
Len Brown, Intel Open Source Technology Center