Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 237330
b: refs/heads/master
c: d37f50e
h: refs/heads/master
v: v3
  • Loading branch information
Andrei Emeltchenko authored and Gustavo F. Padovan committed Feb 8, 2011
1 parent a6762a7 commit ced80f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a08eccedaa1e12b74cf3afea9e11a9aefc29f73
refs/heads/master: d37f50e19094862a5d60d79637d6f4dbdc42f4f1
13 changes: 9 additions & 4 deletions trunk/net/bluetooth/af_bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,15 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)

BT_DBG("parent %p", parent);

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

lock_sock(sk);
bh_lock_sock(sk);

/* FIXME: Is this check still needed */
if (sk->sk_state == BT_CLOSED) {
release_sock(sk);
bh_unlock_sock(sk);
bt_accept_unlink(sk);
continue;
}
Expand All @@ -216,12 +217,16 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
bt_accept_unlink(sk);
if (newsock)
sock_graft(sk, newsock);
release_sock(sk);

bh_unlock_sock(sk);
local_bh_enable();
return sk;
}

release_sock(sk);
bh_unlock_sock(sk);
}
local_bh_enable();

return NULL;
}
EXPORT_SYMBOL(bt_accept_dequeue);
Expand Down

0 comments on commit ced80f7

Please sign in to comment.