diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-10-07 14:39:46 -0700 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-10-13 02:53:30 -0400 |
commit | 2c907b72db4dd4e8af6dccb6e0ac122d78627b8d (patch) | |
tree | 0a980ca3ea0020cc7145b62de382bc5ff2c81daf /drivers/acpi | |
parent | 2906206350b7e13e2047467cc29a0a2d78d71cb2 (diff) | |
download | op-kernel-dev-2c907b72db4dd4e8af6dccb6e0ac122d78627b8d.zip op-kernel-dev-2c907b72db4dd4e8af6dccb6e0ac122d78627b8d.tar.gz |
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: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/button.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 9335b87..0c9c6a9 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -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)) |