diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-20 14:15:56 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-22 11:02:08 -0500 |
commit | 8a154a8feb805394d1fd46281becaf876e18860a (patch) | |
tree | 815452c2ed7e46941bc04a6d9100ebd75c00ec39 /net/bluetooth/af_bluetooth.c | |
parent | f1e91e1640d808d332498a6b09b2bcd01462eff9 (diff) |
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>
Diffstat (limited to 'net/bluetooth/af_bluetooth.c')
-rw-r--r-- | net/bluetooth/af_bluetooth.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 062124cd89cf..cdcfcabb34ab 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
@@ -199,15 +199,14 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock) | |||
199 | 199 | ||
200 | BT_DBG("parent %p", parent); | 200 | BT_DBG("parent %p", parent); |
201 | 201 | ||
202 | local_bh_disable(); | ||
203 | list_for_each_safe(p, n, &bt_sk(parent)->accept_q) { | 202 | list_for_each_safe(p, n, &bt_sk(parent)->accept_q) { |
204 | sk = (struct sock *) list_entry(p, struct bt_sock, accept_q); | 203 | sk = (struct sock *) list_entry(p, struct bt_sock, accept_q); |
205 | 204 | ||
206 | bh_lock_sock(sk); | 205 | lock_sock(sk); |
207 | 206 | ||
208 | /* FIXME: Is this check still needed */ | 207 | /* FIXME: Is this check still needed */ |
209 | if (sk->sk_state == BT_CLOSED) { | 208 | if (sk->sk_state == BT_CLOSED) { |
210 | bh_unlock_sock(sk); | 209 | release_sock(sk); |
211 | bt_accept_unlink(sk); | 210 | bt_accept_unlink(sk); |
212 | continue; | 211 | continue; |
213 | } | 212 | } |
@@ -218,14 +217,12 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock) | |||
218 | if (newsock) | 217 | if (newsock) |
219 | sock_graft(sk, newsock); | 218 | sock_graft(sk, newsock); |
220 | 219 | ||
221 | bh_unlock_sock(sk); | 220 | release_sock(sk); |
222 | local_bh_enable(); | ||
223 | return sk; | 221 | return sk; |
224 | } | 222 | } |
225 | 223 | ||
226 | bh_unlock_sock(sk); | 224 | release_sock(sk); |
227 | } | 225 | } |
228 | local_bh_enable(); | ||
229 | 226 | ||
230 | return NULL; | 227 | return NULL; |
231 | } | 228 | } |