aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 617f58363db..cee46cbe7ae 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -851,11 +851,14 @@ static void hci_cs_add_sco(struct hci_dev *hdev, __u8 status)
851 hci_dev_lock(hdev); 851 hci_dev_lock(hdev);
852 852
853 acl = hci_conn_hash_lookup_handle(hdev, handle); 853 acl = hci_conn_hash_lookup_handle(hdev, handle);
854 if (acl && (sco = acl->link)) { 854 if (acl) {
855 sco->state = BT_CLOSED; 855 sco = acl->link;
856 if (sco) {
857 sco->state = BT_CLOSED;
856 858
857 hci_proto_connect_cfm(sco, status); 859 hci_proto_connect_cfm(sco, status);
858 hci_conn_del(sco); 860 hci_conn_del(sco);
861 }
859 } 862 }
860 863
861 hci_dev_unlock(hdev); 864 hci_dev_unlock(hdev);
@@ -1037,11 +1040,14 @@ static void hci_cs_setup_sync_conn(struct hci_dev *hdev, __u8 status)
1037 hci_dev_lock(hdev); 1040 hci_dev_lock(hdev);
1038 1041
1039 acl = hci_conn_hash_lookup_handle(hdev, handle); 1042 acl = hci_conn_hash_lookup_handle(hdev, handle);
1040 if (acl && (sco = acl->link)) { 1043 if (acl) {
1041 sco->state = BT_CLOSED; 1044 sco = acl->link;
1045 if (sco) {
1046 sco->state = BT_CLOSED;
1042 1047
1043 hci_proto_connect_cfm(sco, status); 1048 hci_proto_connect_cfm(sco, status);
1044 hci_conn_del(sco); 1049 hci_conn_del(sco);
1050 }
1045 } 1051 }
1046 1052
1047 hci_dev_unlock(hdev); 1053 hci_dev_unlock(hdev);