Skip to content

Commit acab8ff

Browse files
iulia-tanasescuVudentz
authored andcommitted
Bluetooth: ISO: Fix invalid context error
This moves the hci_le_terminate_big_sync call from rx_work to cmd_sync_work, to avoid calling sleeping function from an invalid context. Reported-by: [email protected] Fixes: a0bfde1 ("Bluetooth: ISO: Add support for connecting multiple BISes") Signed-off-by: Iulia Tanasescu <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 92d4abd commit acab8ff

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

net/bluetooth/hci_event.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7021,6 +7021,14 @@ static void hci_le_cis_req_evt(struct hci_dev *hdev, void *data,
70217021
hci_dev_unlock(hdev);
70227022
}
70237023

7024+
static int hci_iso_term_big_sync(struct hci_dev *hdev, void *data)
7025+
{
7026+
u8 handle = PTR_UINT(data);
7027+
7028+
return hci_le_terminate_big_sync(hdev, handle,
7029+
HCI_ERROR_LOCAL_HOST_TERM);
7030+
}
7031+
70247032
static void hci_le_create_big_complete_evt(struct hci_dev *hdev, void *data,
70257033
struct sk_buff *skb)
70267034
{
@@ -7065,16 +7073,17 @@ static void hci_le_create_big_complete_evt(struct hci_dev *hdev, void *data,
70657073
rcu_read_lock();
70667074
}
70677075

7076+
rcu_read_unlock();
7077+
70687078
if (!ev->status && !i)
70697079
/* If no BISes have been connected for the BIG,
70707080
* terminate. This is in case all bound connections
70717081
* have been closed before the BIG creation
70727082
* has completed.
70737083
*/
7074-
hci_le_terminate_big_sync(hdev, ev->handle,
7075-
HCI_ERROR_LOCAL_HOST_TERM);
7084+
hci_cmd_sync_queue(hdev, hci_iso_term_big_sync,
7085+
UINT_PTR(ev->handle), NULL);
70767086

7077-
rcu_read_unlock();
70787087
hci_dev_unlock(hdev);
70797088
}
70807089

0 commit comments

Comments
 (0)