Commit 8a154a8f authored by Gustavo F. Padovan's avatar Gustavo F. Padovan

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: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent f1e91e16
...@@ -199,15 +199,14 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock) ...@@ -199,15 +199,14 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
BT_DBG("parent %p", parent); BT_DBG("parent %p", parent);
local_bh_disable();
list_for_each_safe(p, n, &bt_sk(parent)->accept_q) { list_for_each_safe(p, n, &bt_sk(parent)->accept_q) {
sk = (struct sock *) list_entry(p, struct bt_sock, accept_q); sk = (struct sock *) list_entry(p, struct bt_sock, accept_q);
bh_lock_sock(sk); lock_sock(sk);
/* FIXME: Is this check still needed */ /* FIXME: Is this check still needed */
if (sk->sk_state == BT_CLOSED) { if (sk->sk_state == BT_CLOSED) {
bh_unlock_sock(sk); release_sock(sk);
bt_accept_unlink(sk); bt_accept_unlink(sk);
continue; continue;
} }
...@@ -218,14 +217,12 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock) ...@@ -218,14 +217,12 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
if (newsock) if (newsock)
sock_graft(sk, newsock); sock_graft(sk, newsock);
bh_unlock_sock(sk); release_sock(sk);
local_bh_enable();
return sk; return sk;
} }
bh_unlock_sock(sk); release_sock(sk);
} }
local_bh_enable();
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment