Skip to content

Commit e9d50f7

Browse files
committed
Bluetooth: hci_event: Fix Invalid wait context
This fixes the following trace caused by attempting to lock cmd_sync_work_lock while holding the rcu_read_lock: kworker/u3:2/212 is trying to lock: ffff888002600910 (&hdev->cmd_sync_work_lock){+.+.}-{3:3}, at: hci_cmd_sync_queue+0xad/0x140 other info that might help us debug this: context-{4:4} 4 locks held by kworker/u3:2/212: #0: ffff8880028c6530 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_one_work+0x4dc/0x9a0 #1: ffff888001aafde0 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x4dc/0x9a0 #2: ffff888002600070 (&hdev->lock){+.+.}-{3:3}, at: hci_cc_le_set_cig_params+0x64/0x4f0 #3: ffffffffa5994b00 (rcu_read_lock){....}-{1:2}, at: hci_cc_le_set_cig_params+0x2f9/0x4f0 Fixes: 26afbd8 ("Bluetooth: Add initial implementation of CIS connections") Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 6a5ad25 commit e9d50f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/bluetooth/hci_event.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3848,8 +3848,11 @@ static u8 hci_cc_le_set_cig_params(struct hci_dev *hdev, void *data,
38483848
conn->handle, conn->link);
38493849

38503850
/* Create CIS if LE is already connected */
3851-
if (conn->link && conn->link->state == BT_CONNECTED)
3851+
if (conn->link && conn->link->state == BT_CONNECTED) {
3852+
rcu_read_unlock();
38523853
hci_le_create_cis(conn->link);
3854+
rcu_read_lock();
3855+
}
38533856

38543857
if (i == rp->num_handles)
38553858
break;

0 commit comments

Comments
 (0)