diff options
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 | |||
592 | sk->sk_state = BT_CONFIG; | 592 | sk->sk_state = BT_CONFIG; |
593 | chan->state = BT_CONFIG; | 593 | chan->state = BT_CONFIG; |
594 | 594 | ||
595 | /* or for ACL link, under defer_setup time */ | 595 | /* or for ACL link */ |
596 | } else if (sk->sk_state == BT_CONNECT2 && | 596 | } else if ((sk->sk_state == BT_CONNECT2 && |
597 | bt_sk(sk)->defer_setup) { | 597 | bt_sk(sk)->defer_setup) || |
598 | err = l2cap_chan_check_security(chan); | 598 | sk->sk_state == BT_CONNECTED) { |
599 | if (!l2cap_chan_check_security(chan)) | ||
600 | bt_sk(sk)->suspended = true; | ||
601 | else | ||
602 | sk->sk_state_change(sk); | ||
599 | } else { | 603 | } else { |
600 | err = -EINVAL; | 604 | err = -EINVAL; |
601 | } | 605 | } |