diff options
Diffstat (limited to 'net/bluetooth/sco.c')
-rw-r--r-- | net/bluetooth/sco.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index eea17cdcaf7f..531a93d613d4 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -131,15 +131,6 @@ static int sco_conn_del(struct hci_conn *hcon, int err) | |||
131 | sco_sock_clear_timer(sk); | 131 | sco_sock_clear_timer(sk); |
132 | sco_chan_del(sk, err); | 132 | sco_chan_del(sk, err); |
133 | bh_unlock_sock(sk); | 133 | bh_unlock_sock(sk); |
134 | |||
135 | sco_conn_lock(conn); | ||
136 | conn->sk = NULL; | ||
137 | sco_pi(sk)->conn = NULL; | ||
138 | sco_conn_unlock(conn); | ||
139 | |||
140 | if (conn->hcon) | ||
141 | hci_conn_put(conn->hcon); | ||
142 | |||
143 | sco_sock_kill(sk); | 134 | sco_sock_kill(sk); |
144 | } | 135 | } |
145 | 136 | ||
@@ -885,6 +876,16 @@ static void sco_chan_del(struct sock *sk, int err) | |||
885 | 876 | ||
886 | BT_DBG("sk %p, conn %p, err %d", sk, conn, err); | 877 | BT_DBG("sk %p, conn %p, err %d", sk, conn, err); |
887 | 878 | ||
879 | if (conn) { | ||
880 | sco_conn_lock(conn); | ||
881 | conn->sk = NULL; | ||
882 | sco_pi(sk)->conn = NULL; | ||
883 | sco_conn_unlock(conn); | ||
884 | |||
885 | if (conn->hcon) | ||
886 | hci_conn_put(conn->hcon); | ||
887 | } | ||
888 | |||
888 | sk->sk_state = BT_CLOSED; | 889 | sk->sk_state = BT_CLOSED; |
889 | sk->sk_err = err; | 890 | sk->sk_err = err; |
890 | sk->sk_state_change(sk); | 891 | sk->sk_state_change(sk); |