diff options
author | 2020-05-19 14:26:59 +0000 | |
---|---|---|
committer | 2020-05-19 14:26:59 +0000 | |
commit | 30345ed3e01fe2fb32af615930f4aa5d0c3f2702 (patch) | |
tree | 52509e71b667393ceeb26fd1d5d70a311811ee6b | |
parent | Add -status and -servername test for s_server and s_client in appstest.sh (diff) | |
download | wireguard-openbsd-30345ed3e01fe2fb32af615930f4aa5d0c3f2702.tar.xz wireguard-openbsd-30345ed3e01fe2fb32af615930f4aa5d0c3f2702.zip |
Don't provide backlight control if the list returned by _BCL is empty.
Prevents crashes on broken AML.
ok jcs@
-rw-r--r-- | sys/dev/acpi/acpivout.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/acpi/acpivout.c b/sys/dev/acpi/acpivout.c index 86d60b259e9..efb45934be6 100644 --- a/sys/dev/acpi/acpivout.c +++ b/sys/dev/acpi/acpivout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpivout.c,v 1.22 2020/04/19 15:05:14 kettenis Exp $ */ +/* $OpenBSD: acpivout.c,v 1.23 2020/05/19 14:26:59 kettenis Exp $ */ /* * Copyright (c) 2009 Paul Irofti <paul@irofti.net> * @@ -114,12 +114,14 @@ acpivout_attach(struct device *parent, struct device *self, void *aux) ws_get_param || ws_set_param) return; - ws_get_param = acpivout_get_param; - ws_set_param = acpivout_set_param; - acpivout_get_bcl(sc); + if (sc->sc_bcl_len == 0) + return; sc->sc_brightness = acpivout_get_brightness(sc); + + ws_get_param = acpivout_get_param; + ws_set_param = acpivout_set_param; } int |