summaryrefslogtreecommitdiffstats
path: root/sys/dev/adb
diff options
context:
space:
mode:
authorjhibbits <jhibbits@FreeBSD.org>2012-06-23 13:52:44 +0000
committerjhibbits <jhibbits@FreeBSD.org>2012-06-23 13:52:44 +0000
commitd61b5a4dc1917b15e9a151ef75432f44aa697344 (patch)
tree32717fd2197573546e414f34a07429051cf57791 /sys/dev/adb
parentda6a8fd01ace73ef3f5c3ae53e4da912dae23434 (diff)
downloadFreeBSD-src-d61b5a4dc1917b15e9a151ef75432f44aa697344.zip
FreeBSD-src-d61b5a4dc1917b15e9a151ef75432f44aa697344.tar.gz
Release the ADB keyboard mutex when handling the power button
press/release. Found by WITNESS. Approved by: nwhitehorn (mentor) MFC after: 3 days
Diffstat (limited to 'sys/dev/adb')
-rw-r--r--sys/dev/adb/adb_kbd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/adb/adb_kbd.c b/sys/dev/adb/adb_kbd.c
index e69c4db..75899c9 100644
--- a/sys/dev/adb/adb_kbd.c
+++ b/sys/dev/adb/adb_kbd.c
@@ -426,8 +426,10 @@ adb_kbd_receive_packet(device_t dev, u_char status,
/* 0x7f is always the power button */
if (data[0] == 0x7f && devctl_process_running()) {
devctl_notify("PMU", "Button", "pressed", NULL);
+ mtx_unlock(&sc->sc_mutex);
return (0);
} else if (data[0] == 0xff) {
+ mtx_unlock(&sc->sc_mutex);
return (0); /* Ignore power button release. */
}
if ((data[0] & 0x7f) == 57 && sc->buffers < 7) {
OpenPOWER on IntegriCloud