Skip to content

Commit

Permalink
ACPI button: don't try to use a non-existent lid device
Browse files Browse the repository at this point in the history
If a call comes in to check the lid state but there's no lid device
present, we should return -ENODEV.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Jesse Barnes authored and Len Brown committed Oct 13, 2009
1 parent 2906206 commit 2c907b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/acpi/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2c907b7

Please sign in to comment.