diff options
author | H. Peter Anvin <hpa@zytor.com> | 2012-05-21 21:17:50 +0200 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-05-21 21:17:50 +0200 |
commit | d13a822e6d08733cc69dd8c2f5d82eacb1474295 (patch) | |
tree | 2b39613c0d8cce9eb3b15adb1525a2c72f46d392 /net/bluetooth/l2cap_sock.c | |
parent | x86, printk: Add missing KERN_CONT to NMI selftest (diff) | |
parent | Linux 3.4 (diff) | |
download | linux-d13a822e6d08733cc69dd8c2f5d82eacb1474295.tar.xz linux-d13a822e6d08733cc69dd8c2f5d82eacb1474295.zip |
Merge commit 'v3.4' into x86/urgent
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 29122ed28ea9..04e7c172d49c 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -592,10 +592,14 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch sk->sk_state = BT_CONFIG; chan->state = BT_CONFIG; - /* or for ACL link, under defer_setup time */ - } else if (sk->sk_state == BT_CONNECT2 && - bt_sk(sk)->defer_setup) { - err = l2cap_chan_check_security(chan); + /* or for ACL link */ + } else if ((sk->sk_state == BT_CONNECT2 && + bt_sk(sk)->defer_setup) || + sk->sk_state == BT_CONNECTED) { + if (!l2cap_chan_check_security(chan)) + bt_sk(sk)->suspended = true; + else + sk->sk_state_change(sk); } else { err = -EINVAL; } |