]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
Bluetooth: SCO: fix sleeping under spinlock in sco_conn_ready
authorPauli Virtanen <pav@iki.fi>
Sun, 12 Apr 2026 18:47:42 +0000 (21:47 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 6 May 2026 19:58:29 +0000 (15:58 -0400)
commitb819db93d73f4593636299e229914052b89e3ef2
tree0fabf2cbbcbcf88da9db872b7f365e7bc773b8ea
parentb89e0100a5f6885f9748bbacc3f4e3bcff654e4c
Bluetooth: SCO: fix sleeping under spinlock in sco_conn_ready

sco_conn_ready calls sleeping functions under conn->lock spinlock.

The critical section can be reduced: conn->hcon is modified only with
hdev->lock held. It is guaranteed to be held in sco_conn_ready, so
conn->lock is not needed to guard it.

Move taking conn->lock after lock_sock(parent). This also follows the
lock ordering lock_sock() > conn->lock elsewhere in the file.

Fixes: 27c24fda62b60 ("Bluetooth: switch to lock_sock in SCO")
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/sco.c