diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-04-04 18:06:05 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-04-05 11:58:40 -0400 |
commit | 1322901da5094cecd9826ec3aaade83f6452cc45 (patch) | |
tree | ca4eef345dd66e292402b53f613c7337673c9e1d /net | |
parent | fada4ac33992b1f953d95584e36f6ca7860aea40 (diff) |
Bluetooth: Don't use spin_lock_bh in user context
spin_lock() and spin_unlock() are more apropiated for user context.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/mgmt.c | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 9a61320c5f2e..c32238163b72 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -179,7 +179,7 @@ static int read_controller_info(struct sock *sk, u16 index) | |||
179 | 179 | ||
180 | hci_del_off_timer(hdev); | 180 | hci_del_off_timer(hdev); |
181 | 181 | ||
182 | hci_dev_lock_bh(hdev); | 182 | hci_dev_lock(hdev); |
183 | 183 | ||
184 | set_bit(HCI_MGMT, &hdev->flags); | 184 | set_bit(HCI_MGMT, &hdev->flags); |
185 | 185 | ||
@@ -208,7 +208,7 @@ static int read_controller_info(struct sock *sk, u16 index) | |||
208 | 208 | ||
209 | memcpy(rp.name, hdev->dev_name, sizeof(hdev->dev_name)); | 209 | memcpy(rp.name, hdev->dev_name, sizeof(hdev->dev_name)); |
210 | 210 | ||
211 | hci_dev_unlock_bh(hdev); | 211 | hci_dev_unlock(hdev); |
212 | hci_dev_put(hdev); | 212 | hci_dev_put(hdev); |
213 | 213 | ||
214 | return cmd_complete(sk, index, MGMT_OP_READ_INFO, &rp, sizeof(rp)); | 214 | return cmd_complete(sk, index, MGMT_OP_READ_INFO, &rp, sizeof(rp)); |
@@ -316,7 +316,7 @@ static int set_powered(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
316 | if (!hdev) | 316 | if (!hdev) |
317 | return cmd_status(sk, index, MGMT_OP_SET_POWERED, ENODEV); | 317 | return cmd_status(sk, index, MGMT_OP_SET_POWERED, ENODEV); |
318 | 318 | ||
319 | hci_dev_lock_bh(hdev); | 319 | hci_dev_lock(hdev); |
320 | 320 | ||
321 | up = test_bit(HCI_UP, &hdev->flags); | 321 | up = test_bit(HCI_UP, &hdev->flags); |
322 | if ((cp->val && up) || (!cp->val && !up)) { | 322 | if ((cp->val && up) || (!cp->val && !up)) { |
@@ -343,7 +343,7 @@ static int set_powered(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
343 | err = 0; | 343 | err = 0; |
344 | 344 | ||
345 | failed: | 345 | failed: |
346 | hci_dev_unlock_bh(hdev); | 346 | hci_dev_unlock(hdev); |
347 | hci_dev_put(hdev); | 347 | hci_dev_put(hdev); |
348 | return err; | 348 | return err; |
349 | } | 349 | } |
@@ -368,7 +368,7 @@ static int set_discoverable(struct sock *sk, u16 index, unsigned char *data, | |||
368 | if (!hdev) | 368 | if (!hdev) |
369 | return cmd_status(sk, index, MGMT_OP_SET_DISCOVERABLE, ENODEV); | 369 | return cmd_status(sk, index, MGMT_OP_SET_DISCOVERABLE, ENODEV); |
370 | 370 | ||
371 | hci_dev_lock_bh(hdev); | 371 | hci_dev_lock(hdev); |
372 | 372 | ||
373 | if (!test_bit(HCI_UP, &hdev->flags)) { | 373 | if (!test_bit(HCI_UP, &hdev->flags)) { |
374 | err = cmd_status(sk, index, MGMT_OP_SET_DISCOVERABLE, ENETDOWN); | 374 | err = cmd_status(sk, index, MGMT_OP_SET_DISCOVERABLE, ENETDOWN); |
@@ -403,7 +403,7 @@ static int set_discoverable(struct sock *sk, u16 index, unsigned char *data, | |||
403 | mgmt_pending_remove(cmd); | 403 | mgmt_pending_remove(cmd); |
404 | 404 | ||
405 | failed: | 405 | failed: |
406 | hci_dev_unlock_bh(hdev); | 406 | hci_dev_unlock(hdev); |
407 | hci_dev_put(hdev); | 407 | hci_dev_put(hdev); |
408 | 408 | ||
409 | return err; | 409 | return err; |
@@ -429,7 +429,7 @@ static int set_connectable(struct sock *sk, u16 index, unsigned char *data, | |||
429 | if (!hdev) | 429 | if (!hdev) |
430 | return cmd_status(sk, index, MGMT_OP_SET_CONNECTABLE, ENODEV); | 430 | return cmd_status(sk, index, MGMT_OP_SET_CONNECTABLE, ENODEV); |
431 | 431 | ||
432 | hci_dev_lock_bh(hdev); | 432 | hci_dev_lock(hdev); |
433 | 433 | ||
434 | if (!test_bit(HCI_UP, &hdev->flags)) { | 434 | if (!test_bit(HCI_UP, &hdev->flags)) { |
435 | err = cmd_status(sk, index, MGMT_OP_SET_CONNECTABLE, ENETDOWN); | 435 | err = cmd_status(sk, index, MGMT_OP_SET_CONNECTABLE, ENETDOWN); |
@@ -463,7 +463,7 @@ static int set_connectable(struct sock *sk, u16 index, unsigned char *data, | |||
463 | mgmt_pending_remove(cmd); | 463 | mgmt_pending_remove(cmd); |
464 | 464 | ||
465 | failed: | 465 | failed: |
466 | hci_dev_unlock_bh(hdev); | 466 | hci_dev_unlock(hdev); |
467 | hci_dev_put(hdev); | 467 | hci_dev_put(hdev); |
468 | 468 | ||
469 | return err; | 469 | return err; |
@@ -522,7 +522,7 @@ static int set_pairable(struct sock *sk, u16 index, unsigned char *data, | |||
522 | if (!hdev) | 522 | if (!hdev) |
523 | return cmd_status(sk, index, MGMT_OP_SET_PAIRABLE, ENODEV); | 523 | return cmd_status(sk, index, MGMT_OP_SET_PAIRABLE, ENODEV); |
524 | 524 | ||
525 | hci_dev_lock_bh(hdev); | 525 | hci_dev_lock(hdev); |
526 | 526 | ||
527 | if (cp->val) | 527 | if (cp->val) |
528 | set_bit(HCI_PAIRABLE, &hdev->flags); | 528 | set_bit(HCI_PAIRABLE, &hdev->flags); |
@@ -538,7 +538,7 @@ static int set_pairable(struct sock *sk, u16 index, unsigned char *data, | |||
538 | err = mgmt_event(MGMT_EV_PAIRABLE, index, &ev, sizeof(ev), sk); | 538 | err = mgmt_event(MGMT_EV_PAIRABLE, index, &ev, sizeof(ev), sk); |
539 | 539 | ||
540 | failed: | 540 | failed: |
541 | hci_dev_unlock_bh(hdev); | 541 | hci_dev_unlock(hdev); |
542 | hci_dev_put(hdev); | 542 | hci_dev_put(hdev); |
543 | 543 | ||
544 | return err; | 544 | return err; |
@@ -739,7 +739,7 @@ static int add_uuid(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
739 | if (!hdev) | 739 | if (!hdev) |
740 | return cmd_status(sk, index, MGMT_OP_ADD_UUID, ENODEV); | 740 | return cmd_status(sk, index, MGMT_OP_ADD_UUID, ENODEV); |
741 | 741 | ||
742 | hci_dev_lock_bh(hdev); | 742 | hci_dev_lock(hdev); |
743 | 743 | ||
744 | uuid = kmalloc(sizeof(*uuid), GFP_ATOMIC); | 744 | uuid = kmalloc(sizeof(*uuid), GFP_ATOMIC); |
745 | if (!uuid) { | 745 | if (!uuid) { |
@@ -763,7 +763,7 @@ static int add_uuid(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
763 | err = cmd_complete(sk, index, MGMT_OP_ADD_UUID, NULL, 0); | 763 | err = cmd_complete(sk, index, MGMT_OP_ADD_UUID, NULL, 0); |
764 | 764 | ||
765 | failed: | 765 | failed: |
766 | hci_dev_unlock_bh(hdev); | 766 | hci_dev_unlock(hdev); |
767 | hci_dev_put(hdev); | 767 | hci_dev_put(hdev); |
768 | 768 | ||
769 | return err; | 769 | return err; |
@@ -788,7 +788,7 @@ static int remove_uuid(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
788 | if (!hdev) | 788 | if (!hdev) |
789 | return cmd_status(sk, index, MGMT_OP_REMOVE_UUID, ENODEV); | 789 | return cmd_status(sk, index, MGMT_OP_REMOVE_UUID, ENODEV); |
790 | 790 | ||
791 | hci_dev_lock_bh(hdev); | 791 | hci_dev_lock(hdev); |
792 | 792 | ||
793 | if (memcmp(cp->uuid, bt_uuid_any, 16) == 0) { | 793 | if (memcmp(cp->uuid, bt_uuid_any, 16) == 0) { |
794 | err = hci_uuids_clear(hdev); | 794 | err = hci_uuids_clear(hdev); |
@@ -823,7 +823,7 @@ static int remove_uuid(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
823 | err = cmd_complete(sk, index, MGMT_OP_REMOVE_UUID, NULL, 0); | 823 | err = cmd_complete(sk, index, MGMT_OP_REMOVE_UUID, NULL, 0); |
824 | 824 | ||
825 | unlock: | 825 | unlock: |
826 | hci_dev_unlock_bh(hdev); | 826 | hci_dev_unlock(hdev); |
827 | hci_dev_put(hdev); | 827 | hci_dev_put(hdev); |
828 | 828 | ||
829 | return err; | 829 | return err; |
@@ -847,7 +847,7 @@ static int set_dev_class(struct sock *sk, u16 index, unsigned char *data, | |||
847 | if (!hdev) | 847 | if (!hdev) |
848 | return cmd_status(sk, index, MGMT_OP_SET_DEV_CLASS, ENODEV); | 848 | return cmd_status(sk, index, MGMT_OP_SET_DEV_CLASS, ENODEV); |
849 | 849 | ||
850 | hci_dev_lock_bh(hdev); | 850 | hci_dev_lock(hdev); |
851 | 851 | ||
852 | hdev->major_class = cp->major; | 852 | hdev->major_class = cp->major; |
853 | hdev->minor_class = cp->minor; | 853 | hdev->minor_class = cp->minor; |
@@ -857,7 +857,7 @@ static int set_dev_class(struct sock *sk, u16 index, unsigned char *data, | |||
857 | if (err == 0) | 857 | if (err == 0) |
858 | err = cmd_complete(sk, index, MGMT_OP_SET_DEV_CLASS, NULL, 0); | 858 | err = cmd_complete(sk, index, MGMT_OP_SET_DEV_CLASS, NULL, 0); |
859 | 859 | ||
860 | hci_dev_unlock_bh(hdev); | 860 | hci_dev_unlock(hdev); |
861 | hci_dev_put(hdev); | 861 | hci_dev_put(hdev); |
862 | 862 | ||
863 | return err; | 863 | return err; |
@@ -879,7 +879,7 @@ static int set_service_cache(struct sock *sk, u16 index, unsigned char *data, | |||
879 | if (!hdev) | 879 | if (!hdev) |
880 | return cmd_status(sk, index, MGMT_OP_SET_SERVICE_CACHE, ENODEV); | 880 | return cmd_status(sk, index, MGMT_OP_SET_SERVICE_CACHE, ENODEV); |
881 | 881 | ||
882 | hci_dev_lock_bh(hdev); | 882 | hci_dev_lock(hdev); |
883 | 883 | ||
884 | BT_DBG("hci%u enable %d", index, cp->enable); | 884 | BT_DBG("hci%u enable %d", index, cp->enable); |
885 | 885 | ||
@@ -897,7 +897,7 @@ static int set_service_cache(struct sock *sk, u16 index, unsigned char *data, | |||
897 | err = cmd_complete(sk, index, MGMT_OP_SET_SERVICE_CACHE, NULL, | 897 | err = cmd_complete(sk, index, MGMT_OP_SET_SERVICE_CACHE, NULL, |
898 | 0); | 898 | 0); |
899 | 899 | ||
900 | hci_dev_unlock_bh(hdev); | 900 | hci_dev_unlock(hdev); |
901 | hci_dev_put(hdev); | 901 | hci_dev_put(hdev); |
902 | 902 | ||
903 | return err; | 903 | return err; |
@@ -931,7 +931,7 @@ static int load_keys(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
931 | BT_DBG("hci%u debug_keys %u key_count %u", index, cp->debug_keys, | 931 | BT_DBG("hci%u debug_keys %u key_count %u", index, cp->debug_keys, |
932 | key_count); | 932 | key_count); |
933 | 933 | ||
934 | hci_dev_lock_bh(hdev); | 934 | hci_dev_lock(hdev); |
935 | 935 | ||
936 | hci_link_keys_clear(hdev); | 936 | hci_link_keys_clear(hdev); |
937 | 937 | ||
@@ -949,7 +949,7 @@ static int load_keys(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
949 | key->pin_len); | 949 | key->pin_len); |
950 | } | 950 | } |
951 | 951 | ||
952 | hci_dev_unlock_bh(hdev); | 952 | hci_dev_unlock(hdev); |
953 | hci_dev_put(hdev); | 953 | hci_dev_put(hdev); |
954 | 954 | ||
955 | return 0; | 955 | return 0; |
@@ -971,7 +971,7 @@ static int remove_key(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
971 | if (!hdev) | 971 | if (!hdev) |
972 | return cmd_status(sk, index, MGMT_OP_REMOVE_KEY, ENODEV); | 972 | return cmd_status(sk, index, MGMT_OP_REMOVE_KEY, ENODEV); |
973 | 973 | ||
974 | hci_dev_lock_bh(hdev); | 974 | hci_dev_lock(hdev); |
975 | 975 | ||
976 | err = hci_remove_link_key(hdev, &cp->bdaddr); | 976 | err = hci_remove_link_key(hdev, &cp->bdaddr); |
977 | if (err < 0) { | 977 | if (err < 0) { |
@@ -994,7 +994,7 @@ static int remove_key(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
994 | } | 994 | } |
995 | 995 | ||
996 | unlock: | 996 | unlock: |
997 | hci_dev_unlock_bh(hdev); | 997 | hci_dev_unlock(hdev); |
998 | hci_dev_put(hdev); | 998 | hci_dev_put(hdev); |
999 | 999 | ||
1000 | return err; | 1000 | return err; |
@@ -1020,7 +1020,7 @@ static int disconnect(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
1020 | if (!hdev) | 1020 | if (!hdev) |
1021 | return cmd_status(sk, index, MGMT_OP_DISCONNECT, ENODEV); | 1021 | return cmd_status(sk, index, MGMT_OP_DISCONNECT, ENODEV); |
1022 | 1022 | ||
1023 | hci_dev_lock_bh(hdev); | 1023 | hci_dev_lock(hdev); |
1024 | 1024 | ||
1025 | if (!test_bit(HCI_UP, &hdev->flags)) { | 1025 | if (!test_bit(HCI_UP, &hdev->flags)) { |
1026 | err = cmd_status(sk, index, MGMT_OP_DISCONNECT, ENETDOWN); | 1026 | err = cmd_status(sk, index, MGMT_OP_DISCONNECT, ENETDOWN); |
@@ -1052,7 +1052,7 @@ static int disconnect(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
1052 | mgmt_pending_remove(cmd); | 1052 | mgmt_pending_remove(cmd); |
1053 | 1053 | ||
1054 | failed: | 1054 | failed: |
1055 | hci_dev_unlock_bh(hdev); | 1055 | hci_dev_unlock(hdev); |
1056 | hci_dev_put(hdev); | 1056 | hci_dev_put(hdev); |
1057 | 1057 | ||
1058 | return err; | 1058 | return err; |
@@ -1073,7 +1073,7 @@ static int get_connections(struct sock *sk, u16 index) | |||
1073 | if (!hdev) | 1073 | if (!hdev) |
1074 | return cmd_status(sk, index, MGMT_OP_GET_CONNECTIONS, ENODEV); | 1074 | return cmd_status(sk, index, MGMT_OP_GET_CONNECTIONS, ENODEV); |
1075 | 1075 | ||
1076 | hci_dev_lock_bh(hdev); | 1076 | hci_dev_lock(hdev); |
1077 | 1077 | ||
1078 | count = 0; | 1078 | count = 0; |
1079 | list_for_each(p, &hdev->conn_hash.list) { | 1079 | list_for_each(p, &hdev->conn_hash.list) { |
@@ -1104,7 +1104,7 @@ static int get_connections(struct sock *sk, u16 index) | |||
1104 | 1104 | ||
1105 | unlock: | 1105 | unlock: |
1106 | kfree(rp); | 1106 | kfree(rp); |
1107 | hci_dev_unlock_bh(hdev); | 1107 | hci_dev_unlock(hdev); |
1108 | hci_dev_put(hdev); | 1108 | hci_dev_put(hdev); |
1109 | return err; | 1109 | return err; |
1110 | } | 1110 | } |
@@ -1129,7 +1129,7 @@ static int pin_code_reply(struct sock *sk, u16 index, unsigned char *data, | |||
1129 | if (!hdev) | 1129 | if (!hdev) |
1130 | return cmd_status(sk, index, MGMT_OP_PIN_CODE_REPLY, ENODEV); | 1130 | return cmd_status(sk, index, MGMT_OP_PIN_CODE_REPLY, ENODEV); |
1131 | 1131 | ||
1132 | hci_dev_lock_bh(hdev); | 1132 | hci_dev_lock(hdev); |
1133 | 1133 | ||
1134 | if (!test_bit(HCI_UP, &hdev->flags)) { | 1134 | if (!test_bit(HCI_UP, &hdev->flags)) { |
1135 | err = cmd_status(sk, index, MGMT_OP_PIN_CODE_REPLY, ENETDOWN); | 1135 | err = cmd_status(sk, index, MGMT_OP_PIN_CODE_REPLY, ENETDOWN); |
@@ -1151,7 +1151,7 @@ static int pin_code_reply(struct sock *sk, u16 index, unsigned char *data, | |||
1151 | mgmt_pending_remove(cmd); | 1151 | mgmt_pending_remove(cmd); |
1152 | 1152 | ||
1153 | failed: | 1153 | failed: |
1154 | hci_dev_unlock_bh(hdev); | 1154 | hci_dev_unlock(hdev); |
1155 | hci_dev_put(hdev); | 1155 | hci_dev_put(hdev); |
1156 | 1156 | ||
1157 | return err; | 1157 | return err; |
@@ -1178,7 +1178,7 @@ static int pin_code_neg_reply(struct sock *sk, u16 index, unsigned char *data, | |||
1178 | return cmd_status(sk, index, MGMT_OP_PIN_CODE_NEG_REPLY, | 1178 | return cmd_status(sk, index, MGMT_OP_PIN_CODE_NEG_REPLY, |
1179 | ENODEV); | 1179 | ENODEV); |
1180 | 1180 | ||
1181 | hci_dev_lock_bh(hdev); | 1181 | hci_dev_lock(hdev); |
1182 | 1182 | ||
1183 | if (!test_bit(HCI_UP, &hdev->flags)) { | 1183 | if (!test_bit(HCI_UP, &hdev->flags)) { |
1184 | err = cmd_status(sk, index, MGMT_OP_PIN_CODE_NEG_REPLY, | 1184 | err = cmd_status(sk, index, MGMT_OP_PIN_CODE_NEG_REPLY, |
@@ -1199,7 +1199,7 @@ static int pin_code_neg_reply(struct sock *sk, u16 index, unsigned char *data, | |||
1199 | mgmt_pending_remove(cmd); | 1199 | mgmt_pending_remove(cmd); |
1200 | 1200 | ||
1201 | failed: | 1201 | failed: |
1202 | hci_dev_unlock_bh(hdev); | 1202 | hci_dev_unlock(hdev); |
1203 | hci_dev_put(hdev); | 1203 | hci_dev_put(hdev); |
1204 | 1204 | ||
1205 | return err; | 1205 | return err; |
@@ -1222,14 +1222,14 @@ static int set_io_capability(struct sock *sk, u16 index, unsigned char *data, | |||
1222 | if (!hdev) | 1222 | if (!hdev) |
1223 | return cmd_status(sk, index, MGMT_OP_SET_IO_CAPABILITY, ENODEV); | 1223 | return cmd_status(sk, index, MGMT_OP_SET_IO_CAPABILITY, ENODEV); |
1224 | 1224 | ||
1225 | hci_dev_lock_bh(hdev); | 1225 | hci_dev_lock(hdev); |
1226 | 1226 | ||
1227 | hdev->io_capability = cp->io_capability; | 1227 | hdev->io_capability = cp->io_capability; |
1228 | 1228 | ||
1229 | BT_DBG("%s IO capability set to 0x%02x", hdev->name, | 1229 | BT_DBG("%s IO capability set to 0x%02x", hdev->name, |
1230 | hdev->io_capability); | 1230 | hdev->io_capability); |
1231 | 1231 | ||
1232 | hci_dev_unlock_bh(hdev); | 1232 | hci_dev_unlock(hdev); |
1233 | hci_dev_put(hdev); | 1233 | hci_dev_put(hdev); |
1234 | 1234 | ||
1235 | return cmd_complete(sk, index, MGMT_OP_SET_IO_CAPABILITY, NULL, 0); | 1235 | return cmd_complete(sk, index, MGMT_OP_SET_IO_CAPABILITY, NULL, 0); |
@@ -1315,7 +1315,7 @@ static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
1315 | if (!hdev) | 1315 | if (!hdev) |
1316 | return cmd_status(sk, index, MGMT_OP_PAIR_DEVICE, ENODEV); | 1316 | return cmd_status(sk, index, MGMT_OP_PAIR_DEVICE, ENODEV); |
1317 | 1317 | ||
1318 | hci_dev_lock_bh(hdev); | 1318 | hci_dev_lock(hdev); |
1319 | 1319 | ||
1320 | if (cp->io_cap == 0x03) { | 1320 | if (cp->io_cap == 0x03) { |
1321 | sec_level = BT_SECURITY_MEDIUM; | 1321 | sec_level = BT_SECURITY_MEDIUM; |
@@ -1357,7 +1357,7 @@ static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len) | |||
1357 | err = 0; | 1357 | err = 0; |
1358 | 1358 | ||
1359 | unlock: | 1359 | unlock: |
1360 | hci_dev_unlock_bh(hdev); | 1360 | hci_dev_unlock(hdev); |
1361 | hci_dev_put(hdev); | 1361 | hci_dev_put(hdev); |
1362 | 1362 | ||
1363 | return err; | 1363 | return err; |
@@ -1389,7 +1389,7 @@ static int user_confirm_reply(struct sock *sk, u16 index, unsigned char *data, | |||
1389 | if (!hdev) | 1389 | if (!hdev) |
1390 | return cmd_status(sk, index, mgmt_op, ENODEV); | 1390 | return cmd_status(sk, index, mgmt_op, ENODEV); |
1391 | 1391 | ||
1392 | hci_dev_lock_bh(hdev); | 1392 | hci_dev_lock(hdev); |
1393 | 1393 | ||
1394 | if (!test_bit(HCI_UP, &hdev->flags)) { | 1394 | if (!test_bit(HCI_UP, &hdev->flags)) { |
1395 | err = cmd_status(sk, index, mgmt_op, ENETDOWN); | 1395 | err = cmd_status(sk, index, mgmt_op, ENETDOWN); |
@@ -1407,7 +1407,7 @@ static int user_confirm_reply(struct sock *sk, u16 index, unsigned char *data, | |||
1407 | mgmt_pending_remove(cmd); | 1407 | mgmt_pending_remove(cmd); |
1408 | 1408 | ||
1409 | failed: | 1409 | failed: |
1410 | hci_dev_unlock_bh(hdev); | 1410 | hci_dev_unlock(hdev); |
1411 | hci_dev_put(hdev); | 1411 | hci_dev_put(hdev); |
1412 | 1412 | ||
1413 | return err; | 1413 | return err; |
@@ -1431,7 +1431,7 @@ static int set_local_name(struct sock *sk, u16 index, unsigned char *data, | |||
1431 | if (!hdev) | 1431 | if (!hdev) |
1432 | return cmd_status(sk, index, MGMT_OP_SET_LOCAL_NAME, ENODEV); | 1432 | return cmd_status(sk, index, MGMT_OP_SET_LOCAL_NAME, ENODEV); |
1433 | 1433 | ||
1434 | hci_dev_lock_bh(hdev); | 1434 | hci_dev_lock(hdev); |
1435 | 1435 | ||
1436 | cmd = mgmt_pending_add(sk, MGMT_OP_SET_LOCAL_NAME, index, data, len); | 1436 | cmd = mgmt_pending_add(sk, MGMT_OP_SET_LOCAL_NAME, index, data, len); |
1437 | if (!cmd) { | 1437 | if (!cmd) { |
@@ -1446,7 +1446,7 @@ static int set_local_name(struct sock *sk, u16 index, unsigned char *data, | |||
1446 | mgmt_pending_remove(cmd); | 1446 | mgmt_pending_remove(cmd); |
1447 | 1447 | ||
1448 | failed: | 1448 | failed: |
1449 | hci_dev_unlock_bh(hdev); | 1449 | hci_dev_unlock(hdev); |
1450 | hci_dev_put(hdev); | 1450 | hci_dev_put(hdev); |
1451 | 1451 | ||
1452 | return err; | 1452 | return err; |
@@ -1465,7 +1465,7 @@ static int read_local_oob_data(struct sock *sk, u16 index) | |||
1465 | return cmd_status(sk, index, MGMT_OP_READ_LOCAL_OOB_DATA, | 1465 | return cmd_status(sk, index, MGMT_OP_READ_LOCAL_OOB_DATA, |
1466 | ENODEV); | 1466 | ENODEV); |
1467 | 1467 | ||
1468 | hci_dev_lock_bh(hdev); | 1468 | hci_dev_lock(hdev); |
1469 | 1469 | ||
1470 | if (!test_bit(HCI_UP, &hdev->flags)) { | 1470 | if (!test_bit(HCI_UP, &hdev->flags)) { |
1471 | err = cmd_status(sk, index, MGMT_OP_READ_LOCAL_OOB_DATA, | 1471 | err = cmd_status(sk, index, MGMT_OP_READ_LOCAL_OOB_DATA, |
@@ -1495,7 +1495,7 @@ static int read_local_oob_data(struct sock *sk, u16 index) | |||
1495 | mgmt_pending_remove(cmd); | 1495 | mgmt_pending_remove(cmd); |
1496 | 1496 | ||
1497 | unlock: | 1497 | unlock: |
1498 | hci_dev_unlock_bh(hdev); | 1498 | hci_dev_unlock(hdev); |
1499 | hci_dev_put(hdev); | 1499 | hci_dev_put(hdev); |
1500 | 1500 | ||
1501 | return err; | 1501 | return err; |
@@ -1519,7 +1519,7 @@ static int add_remote_oob_data(struct sock *sk, u16 index, unsigned char *data, | |||
1519 | return cmd_status(sk, index, MGMT_OP_ADD_REMOTE_OOB_DATA, | 1519 | return cmd_status(sk, index, MGMT_OP_ADD_REMOTE_OOB_DATA, |
1520 | ENODEV); | 1520 | ENODEV); |
1521 | 1521 | ||
1522 | hci_dev_lock_bh(hdev); | 1522 | hci_dev_lock(hdev); |
1523 | 1523 | ||
1524 | err = hci_add_remote_oob_data(hdev, &cp->bdaddr, cp->hash, | 1524 | err = hci_add_remote_oob_data(hdev, &cp->bdaddr, cp->hash, |
1525 | cp->randomizer); | 1525 | cp->randomizer); |
@@ -1529,7 +1529,7 @@ static int add_remote_oob_data(struct sock *sk, u16 index, unsigned char *data, | |||
1529 | err = cmd_complete(sk, index, MGMT_OP_ADD_REMOTE_OOB_DATA, NULL, | 1529 | err = cmd_complete(sk, index, MGMT_OP_ADD_REMOTE_OOB_DATA, NULL, |
1530 | 0); | 1530 | 0); |
1531 | 1531 | ||
1532 | hci_dev_unlock_bh(hdev); | 1532 | hci_dev_unlock(hdev); |
1533 | hci_dev_put(hdev); | 1533 | hci_dev_put(hdev); |
1534 | 1534 | ||
1535 | return err; | 1535 | return err; |
@@ -1553,7 +1553,7 @@ static int remove_remote_oob_data(struct sock *sk, u16 index, | |||
1553 | return cmd_status(sk, index, MGMT_OP_REMOVE_REMOTE_OOB_DATA, | 1553 | return cmd_status(sk, index, MGMT_OP_REMOVE_REMOTE_OOB_DATA, |
1554 | ENODEV); | 1554 | ENODEV); |
1555 | 1555 | ||
1556 | hci_dev_lock_bh(hdev); | 1556 | hci_dev_lock(hdev); |
1557 | 1557 | ||
1558 | err = hci_remove_remote_oob_data(hdev, &cp->bdaddr); | 1558 | err = hci_remove_remote_oob_data(hdev, &cp->bdaddr); |
1559 | if (err < 0) | 1559 | if (err < 0) |
@@ -1563,7 +1563,7 @@ static int remove_remote_oob_data(struct sock *sk, u16 index, | |||
1563 | err = cmd_complete(sk, index, MGMT_OP_REMOVE_REMOTE_OOB_DATA, | 1563 | err = cmd_complete(sk, index, MGMT_OP_REMOVE_REMOTE_OOB_DATA, |
1564 | NULL, 0); | 1564 | NULL, 0); |
1565 | 1565 | ||
1566 | hci_dev_unlock_bh(hdev); | 1566 | hci_dev_unlock(hdev); |
1567 | hci_dev_put(hdev); | 1567 | hci_dev_put(hdev); |
1568 | 1568 | ||
1569 | return err; | 1569 | return err; |