summaryrefslogtreecommitdiff
path: root/sys/dev/bluetooth
diff options
context:
space:
mode:
authorrkujawa <rkujawa@NetBSD.org>2011-12-31 01:16:09 +0000
committerrkujawa <rkujawa@NetBSD.org>2011-12-31 01:16:09 +0000
commite7e2cf8d62a9f7f6094c4c1687db2deb502764ea (patch)
treebfb97e83239e5f657d9dff72e58525b5058c6513 /sys/dev/bluetooth
parent0704ca201e5b94a5c5d450fdf9e881409a3ba35f (diff)
Fix panic triggered by pressing the caps lock key:
http://c0ff33.net/drop/bt_caps_panic.jpg OK'd mrg.
Diffstat (limited to 'sys/dev/bluetooth')
-rw-r--r--sys/dev/bluetooth/bthidev.c7
-rw-r--r--sys/dev/bluetooth/btkbd.c6
2 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/bluetooth/bthidev.c b/sys/dev/bluetooth/bthidev.c
index 4c97370ffb0..1bd1a951859 100644
--- a/sys/dev/bluetooth/bthidev.c
+++ b/sys/dev/bluetooth/bthidev.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bthidev.c,v 1.19 2010/04/28 06:13:51 plunky Exp $ */
+/* $NetBSD: bthidev.c,v 1.20 2011/12/31 01:16:09 rkujawa Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bthidev.c,v 1.19 2010/04/28 06:13:51 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bthidev.c,v 1.20 2011/12/31 01:16:09 rkujawa Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -919,9 +919,8 @@ bthidev_output(struct bthidev *hidev, uint8_t *report, int rlen)
memcpy(mtod(m, uint8_t *) + 2, report, rlen);
m->m_pkthdr.len = m->m_len = rlen + 2;
- mutex_enter(bt_lock);
+ KASSERT(mutex_owned(bt_lock));
err = l2cap_send(sc->sc_int, m);
- mutex_exit(bt_lock);
return err;
}
diff --git a/sys/dev/bluetooth/btkbd.c b/sys/dev/bluetooth/btkbd.c
index 72fc4b404b2..a31eefb5286 100644
--- a/sys/dev/bluetooth/btkbd.c
+++ b/sys/dev/bluetooth/btkbd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: btkbd.c,v 1.11 2009/05/12 12:10:46 cegger Exp $ */
+/* $NetBSD: btkbd.c,v 1.12 2011/12/31 01:16:09 rkujawa Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: btkbd.c,v 1.11 2009/05/12 12:10:46 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btkbd.c,v 1.12 2011/12/31 01:16:09 rkujawa Exp $");
#include <sys/param.h>
#include <sys/callout.h>
@@ -378,7 +378,9 @@ btkbd_ioctl(void *self, unsigned long cmd, void *data, int flag,
break;
case WSKBDIO_SETLEDS:
+ mutex_enter(bt_lock);
btkbd_set_leds(sc, *(int *)data);
+ mutex_exit(bt_lock);
break;
case WSKBDIO_GETLEDS: