summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_sock.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-05-21 21:17:50 +0200
committerH. Peter Anvin <hpa@zytor.com>2012-05-21 21:17:50 +0200
commitd13a822e6d08733cc69dd8c2f5d82eacb1474295 (patch)
tree2b39613c0d8cce9eb3b15adb1525a2c72f46d392 /net/bluetooth/l2cap_sock.c
parentx86, printk: Add missing KERN_CONT to NMI selftest (diff)
parentLinux 3.4 (diff)
downloadlinux-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.c12
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;
}