summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2015-12-16 15:43:14 +0000
committerkettenis <kettenis@openbsd.org>2015-12-16 15:43:14 +0000
commita77df94a22cf4a84f329d2f61565f69e5451f078 (patch)
treef476e7467348547c8c7a0b8538c12b787d1ab4a8
parentRefactor umass_detach() in order to pass a size to free(9). (diff)
downloadwireguard-openbsd-a77df94a22cf4a84f329d2f61565f69e5451f078.tar.xz
wireguard-openbsd-a77df94a22cf4a84f329d2f61565f69e5451f078.zip
Don't attempt to get the ThinkLight state if neither the KLCG nor the MLCG
methods are present. Should fix the panic that occurs on older ThinkPads (such as the x201) when you press the ThinkLight key.
-rw-r--r--sys/dev/acpi/acpithinkpad.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpithinkpad.c b/sys/dev/acpi/acpithinkpad.c
index 687f7cc5a24..ebc4f3e48f2 100644
--- a/sys/dev/acpi/acpithinkpad.c
+++ b/sys/dev/acpi/acpithinkpad.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpithinkpad.c,v 1.48 2015/12/14 18:48:50 kettenis Exp $ */
+/* $OpenBSD: acpithinkpad.c,v 1.49 2015/12/16 15:43:14 kettenis Exp $ */
/*
* Copyright (c) 2008 joshua stein <jcs@openbsd.org>
*
@@ -583,8 +583,9 @@ thinkpad_activate(struct device *self, int act)
void
thinkpad_get_thinklight(struct acpithinkpad_softc *sc)
{
- aml_evalinteger(sc->sc_acpi, sc->sc_devnode,
- sc->sc_thinklight_get, 0, NULL, &sc->sc_thinklight);
+ if (sc->sc_thinklight_get)
+ aml_evalinteger(sc->sc_acpi, sc->sc_devnode,
+ sc->sc_thinklight_get, 0, NULL, &sc->sc_thinklight);
}
void