summaryrefslogtreecommitdiff
path: root/net/bluetooth
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-12-28 13:54:17 -0200
committerGustavo F. Padovan <padovan@profusion.mobi>2012-01-03 01:38:37 -0200
commit3542b854bc26e5f8e42e0eab4d7f7453b74a362d (patch)
tree1958fa65523d15edec3813a664a6199e90727254 /net/bluetooth
parent333055f2aaabadb951b5ecd90f6a20a9aee38c29 (diff)
downloadlinux-stable-3542b854bc26e5f8e42e0eab4d7f7453b74a362d.tar.gz
linux-stable-3542b854bc26e5f8e42e0eab4d7f7453b74a362d.tar.bz2
linux-stable-3542b854bc26e5f8e42e0eab4d7f7453b74a362d.zip
Bluetooth: Keep chan->state and sk->sk_state in sync
Those vars need to be in sync, otherwise l2cap_core.c can get the wrong state. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/l2cap_sock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 9ca5616166f7..c61d967012b2 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -587,6 +587,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch
if (smp_conn_security(conn, sec.level))
break;
sk->sk_state = BT_CONFIG;
+ chan->state = BT_CONFIG;
/* or for ACL link, under defer_setup time */
} else if (sk->sk_state == BT_CONNECT2 &&
@@ -731,6 +732,7 @@ static int l2cap_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct ms
if (sk->sk_state == BT_CONNECT2 && bt_sk(sk)->defer_setup) {
sk->sk_state = BT_CONFIG;
+ pi->chan->state = BT_CONFIG;
__l2cap_connect_rsp_defer(pi->chan);
release_sock(sk);