aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorLamarque V. Souza <lamarque@gmail.com>2012-12-06 09:39:55 -0500
committerJiri Kosina <jkosina@suse.cz>2012-12-07 05:12:27 -0500
commit4529eefad087f97b33c0f31984d924b1f15d7bae (patch)
treeb88ae9ea27c1c46a7e991778ad91e4b89b36cda9 /net/bluetooth
parentae751fa82dd8e5a79932d6b55742e7e298afd733 (diff)
HID: hidp: fallback to input session properly if hid is blacklisted
This patch against kernel 3.7.0-rc8 fixes a kernel oops when turning on the bluetooth mouse with id 0458:0058 [1]. The mouse in question supports both input and hid sessions, however it is blacklisted in drivers/hid/hid-core.c so the input session is one that should be used. Long ago (around kernel 3.0.0) some changes in the bluetooth subsystem made the kernel do not fallback to input session when hid session is not supported or blacklisted. This patch restore that behaviour by making the kernel try the input session if hid_add_device returns ENODEV. The patch exports hid_ignore() from hid-core.c so that it can be used in the bluetooth subsystem. [1] https://bugzilla.kernel.org/show_bug.cgi?id=39882 Signed-off-by: Lamarque V. Souza <lamarque@gmail.com> Acked-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hidp/core.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index ccd985da6518..1f4a32bb2971 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -941,6 +941,13 @@ static int hidp_setup_hid(struct hidp_session *session,
941 hid->hid_get_raw_report = hidp_get_raw_report; 941 hid->hid_get_raw_report = hidp_get_raw_report;
942 hid->hid_output_raw_report = hidp_output_raw_report; 942 hid->hid_output_raw_report = hidp_output_raw_report;
943 943
944 /* True if device is blacklisted in drivers/hid/hid-core.c */
945 if (hid_ignore(hid)) {
946 hid_destroy_device(session->hid);
947 session->hid = NULL;
948 return -ENODEV;
949 }
950
944 return 0; 951 return 0;
945 952
946fault: 953fault:
@@ -1013,7 +1020,7 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
1013 1020
1014 if (req->rd_size > 0) { 1021 if (req->rd_size > 0) {
1015 err = hidp_setup_hid(session, req); 1022 err = hidp_setup_hid(session, req);
1016 if (err) 1023 if (err && err != -ENODEV)
1017 goto purge; 1024 goto purge;
1018 } 1025 }
1019 1026