]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Bluetooth: Disconnect HIDRAW devices on disconnect
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 22 Aug 2009 21:15:53 +0000 (14:15 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 Oct 2009 22:11:53 +0000 (15:11 -0700)
commit 364f63519d94442ed373ac7da79033c8282df46a upstream.

Currently the HID subsystem will create HIDRAW devices for the transport
driver, but it will not disconnect them. Until the HID subsytem gets
fixed, ensure that HIDRAW and HIDDEV devices are disconnected when the
Bluetooth HID device gets removed.

Based on a patch from Brian Rogers <brian@xyzw.org>

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/bluetooth/hidp/core.c

index b18676870d5500e0fff1ece30654b060f373db2d..a7612c503f3c4d6e055c1f27be1b53e0e5d98d35 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <linux/input.h>
 #include <linux/hid.h>
+#include <linux/hidraw.h>
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
@@ -573,6 +574,8 @@ static int hidp_session(void *arg)
        if (session->hid) {
                if (session->hid->claimed & HID_CLAIMED_INPUT)
                        hidinput_disconnect(session->hid);
+               if (session->hid->claimed & HID_CLAIMED_HIDRAW)
+                       hidraw_disconnect(session->hid);
                hid_destroy_device(session->hid);
        }