Skip to content

Commit 8a154a8

Browse files
author
Gustavo F. Padovan
committed
Bluetooth: fix bt_accept_dequeue() to work in process context
No local_bh_disable is needed there once we run everything in process context. The same goes for the replacement of bh_lock_sock() by lock_sock(). Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
1 parent f1e91e1 commit 8a154a8

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

‎net/bluetooth/af_bluetooth.c‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,14 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
199199

200200
BT_DBG("parent %p", parent);
201201

202-
local_bh_disable();
203202
list_for_each_safe(p, n, &bt_sk(parent)->accept_q) {
204203
sk = (struct sock *) list_entry(p, struct bt_sock, accept_q);
205204

206-
bh_lock_sock(sk);
205+
lock_sock(sk);
207206

208207
/* FIXME: Is this check still needed */
209208
if (sk->sk_state == BT_CLOSED) {
210-
bh_unlock_sock(sk);
209+
release_sock(sk);
211210
bt_accept_unlink(sk);
212211
continue;
213212
}
@@ -218,14 +217,12 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
218217
if (newsock)
219218
sock_graft(sk, newsock);
220219

221-
bh_unlock_sock(sk);
222-
local_bh_enable();
220+
release_sock(sk);
223221
return sk;
224222
}
225223

226-
bh_unlock_sock(sk);
224+
release_sock(sk);
227225
}
228-
local_bh_enable();
229226

230227
return NULL;
231228
}

0 commit comments

Comments
 (0)