diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-25 12:37:05 (GMT) |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-25 12:37:05 (GMT) |
commit | 8e5d0661b3948f3c5a143f32d192710375822af2 (patch) | |
tree | ca18920d3f7219f7ffb7ca2fa372b82558938006 /net/bluetooth/sco.c | |
parent | 39a6ac11df6579df0361922f05c43f0fac8daa37 (diff) | |
parent | 5698bd757d55b1bb87edd1a9744ab09c142abfc2 (diff) | |
download | linux-8e5d0661b3948f3c5a143f32d192710375822af2.tar.xz |
Merge tag 'v3.6-rc6' into spi-drivers
Linux 3.6-rc6
Conflicts:
drivers/spi/spi-omap2-mcspi.c
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 40bbe25..3589e21 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); |