diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-08-14 14:42:54 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-08-14 14:42:54 -0400 |
commit | 1e55217e174f4e6920fd441dcd3aaf8e37645460 (patch) | |
tree | 896dcc55f7f3d54022677747cdcfc26897d33549 /net/bluetooth/sco.c | |
parent | 3bf671af14d591ede9251acb0085e8017f3705e7 (diff) | |
parent | 7dd6753f6d2e7e0ccbf2263cef3a9fff6bc89988 (diff) | |
download | blackbird-op-linux-1e55217e174f4e6920fd441dcd3aaf8e37645460.tar.gz blackbird-op-linux-1e55217e174f4e6920fd441dcd3aaf8e37645460.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
Diffstat (limited to 'net/bluetooth/sco.c')
-rw-r--r-- | net/bluetooth/sco.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 40bbe25dcff7..3589e21edb09 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -131,6 +131,15 @@ static int sco_conn_del(struct hci_conn *hcon, int err) sco_sock_clear_timer(sk); sco_chan_del(sk, err); bh_unlock_sock(sk); + + sco_conn_lock(conn); + conn->sk = NULL; + sco_pi(sk)->conn = NULL; + sco_conn_unlock(conn); + + if (conn->hcon) + hci_conn_put(conn->hcon); + sco_sock_kill(sk); } @@ -821,16 +830,6 @@ static void sco_chan_del(struct sock *sk, int err) BT_DBG("sk %p, conn %p, err %d", sk, conn, err); - if (conn) { - sco_conn_lock(conn); - conn->sk = NULL; - sco_pi(sk)->conn = NULL; - sco_conn_unlock(conn); - - if (conn->hcon) - hci_conn_put(conn->hcon); - } - sk->sk_state = BT_CLOSED; sk->sk_err = err; sk->sk_state_change(sk); |