Commit 2c907b72 authored by Jesse Barnes's avatar Jesse Barnes Committed by Len Brown

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.
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 29062063
...@@ -251,6 +251,9 @@ int acpi_lid_open(void) ...@@ -251,6 +251,9 @@ int acpi_lid_open(void)
acpi_status status; acpi_status status;
unsigned long long state; unsigned long long state;
if (!lid_device)
return -ENODEV;
status = acpi_evaluate_integer(lid_device->handle, "_LID", NULL, status = acpi_evaluate_integer(lid_device->handle, "_LID", NULL,
&state); &state);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment