Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224921
b: refs/heads/master
c: a49184c
h: refs/heads/master
i:
  224919: 54ff892
v: v3
  • Loading branch information
Andrei Emeltchenko authored and Gustavo F. Padovan committed Dec 1, 2010
1 parent d64aaa0 commit 260943f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d31dbf6e5989b2fd9a30ec5b25436e94f009d6df
refs/heads/master: a49184c229535ebedbb659214db2d4d1d77b7c07
26 changes: 26 additions & 0 deletions trunk/net/bluetooth/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3078,6 +3078,14 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd
break;

default:
/* don't delete l2cap channel if sk is owned by user */
if (sock_owned_by_user(sk)) {
sk->sk_state = BT_DISCONN;
l2cap_sock_clear_timer(sk);
l2cap_sock_set_timer(sk, HZ / 5);
break;
}

l2cap_chan_del(sk, ECONNREFUSED);
break;
}
Expand Down Expand Up @@ -3283,6 +3291,15 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn, struct l2cap_cmd

sk->sk_shutdown = SHUTDOWN_MASK;

/* don't delete l2cap channel if sk is owned by user */
if (sock_owned_by_user(sk)) {
sk->sk_state = BT_DISCONN;
l2cap_sock_clear_timer(sk);
l2cap_sock_set_timer(sk, HZ / 5);
bh_unlock_sock(sk);
return 0;
}

l2cap_chan_del(sk, ECONNRESET);
bh_unlock_sock(sk);

Expand All @@ -3305,6 +3322,15 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, struct l2cap_cmd
if (!sk)
return 0;

/* don't delete l2cap channel if sk is owned by user */
if (sock_owned_by_user(sk)) {
sk->sk_state = BT_DISCONN;
l2cap_sock_clear_timer(sk);
l2cap_sock_set_timer(sk, HZ / 5);
bh_unlock_sock(sk);
return 0;
}

l2cap_chan_del(sk, 0);
bh_unlock_sock(sk);

Expand Down

0 comments on commit 260943f

Please sign in to comment.