Revert "Bluetooth: use hdev lock for accept_list and reject_list in conn req"
This reverts commit 8ace1e6355
which is
commit fb048cae51bacdfbbda2954af3c213fdb1d484f4 upstream.
It breaks the Android kernel ABI and is not needed for Android devices,
so it is safe to revert for now. If it is determined that it is needed
in the future, it can be brought back in an abi-preserving way.
Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6593a06f315b0b5798602895e095e680f8dbd535
This commit is contained in:
@@ -2709,12 +2709,10 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
hci_dev_lock(hdev);
|
|
||||||
|
|
||||||
if (hci_bdaddr_list_lookup(&hdev->reject_list, &ev->bdaddr,
|
if (hci_bdaddr_list_lookup(&hdev->reject_list, &ev->bdaddr,
|
||||||
BDADDR_BREDR)) {
|
BDADDR_BREDR)) {
|
||||||
hci_reject_conn(hdev, &ev->bdaddr);
|
hci_reject_conn(hdev, &ev->bdaddr);
|
||||||
goto unlock;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Require HCI_CONNECTABLE or an accept list entry to accept the
|
/* Require HCI_CONNECTABLE or an accept list entry to accept the
|
||||||
@@ -2726,11 +2724,13 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
|
|||||||
!hci_bdaddr_list_lookup_with_flags(&hdev->accept_list, &ev->bdaddr,
|
!hci_bdaddr_list_lookup_with_flags(&hdev->accept_list, &ev->bdaddr,
|
||||||
BDADDR_BREDR)) {
|
BDADDR_BREDR)) {
|
||||||
hci_reject_conn(hdev, &ev->bdaddr);
|
hci_reject_conn(hdev, &ev->bdaddr);
|
||||||
goto unlock;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Connection accepted */
|
/* Connection accepted */
|
||||||
|
|
||||||
|
hci_dev_lock(hdev);
|
||||||
|
|
||||||
ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr);
|
ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr);
|
||||||
if (ie)
|
if (ie)
|
||||||
memcpy(ie->data.dev_class, ev->dev_class, 3);
|
memcpy(ie->data.dev_class, ev->dev_class, 3);
|
||||||
@@ -2742,7 +2742,8 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
|
|||||||
HCI_ROLE_SLAVE);
|
HCI_ROLE_SLAVE);
|
||||||
if (!conn) {
|
if (!conn) {
|
||||||
bt_dev_err(hdev, "no memory for new connection");
|
bt_dev_err(hdev, "no memory for new connection");
|
||||||
goto unlock;
|
hci_dev_unlock(hdev);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2782,10 +2783,6 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
|
|||||||
conn->state = BT_CONNECT2;
|
conn->state = BT_CONNECT2;
|
||||||
hci_connect_cfm(conn, 0);
|
hci_connect_cfm(conn, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
unlock:
|
|
||||||
hci_dev_unlock(hdev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 hci_to_mgmt_reason(u8 err)
|
static u8 hci_to_mgmt_reason(u8 err)
|
||||||
|
Reference in New Issue
Block a user