diff options
Diffstat (limited to 'net/bluetooth/l2cap.c')
-rw-r--r-- | net/bluetooth/l2cap.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 252264062f59..30ad59b717d5 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -2150,7 +2150,7 @@ static int l2cap_disconn_ind(struct hci_conn *hcon, u8 reason) | |||
2150 | static int l2cap_auth_cfm(struct hci_conn *hcon, u8 status) | 2150 | static int l2cap_auth_cfm(struct hci_conn *hcon, u8 status) |
2151 | { | 2151 | { |
2152 | struct l2cap_chan_list *l; | 2152 | struct l2cap_chan_list *l; |
2153 | struct l2cap_conn *conn = conn = hcon->l2cap_data; | 2153 | struct l2cap_conn *conn = hcon->l2cap_data; |
2154 | struct l2cap_conn_rsp rsp; | 2154 | struct l2cap_conn_rsp rsp; |
2155 | struct sock *sk; | 2155 | struct sock *sk; |
2156 | int result; | 2156 | int result; |
@@ -2165,11 +2165,17 @@ static int l2cap_auth_cfm(struct hci_conn *hcon, u8 status) | |||
2165 | read_lock(&l->lock); | 2165 | read_lock(&l->lock); |
2166 | 2166 | ||
2167 | for (sk = l->head; sk; sk = l2cap_pi(sk)->next_c) { | 2167 | for (sk = l->head; sk; sk = l2cap_pi(sk)->next_c) { |
2168 | struct l2cap_pinfo *pi = l2cap_pi(sk); | ||
2169 | |||
2168 | bh_lock_sock(sk); | 2170 | bh_lock_sock(sk); |
2169 | 2171 | ||
2170 | if (sk->sk_state != BT_CONNECT2 || | 2172 | if (sk->sk_state != BT_CONNECT2) { |
2171 | (l2cap_pi(sk)->link_mode & L2CAP_LM_ENCRYPT) || | 2173 | bh_unlock_sock(sk); |
2172 | (l2cap_pi(sk)->link_mode & L2CAP_LM_SECURE)) { | 2174 | continue; |
2175 | } | ||
2176 | |||
2177 | if ((pi->link_mode & (L2CAP_LM_ENCRYPT | L2CAP_LM_SECURE)) && | ||
2178 | !(hcon->link_mode & HCI_LM_ENCRYPT)) { | ||
2173 | bh_unlock_sock(sk); | 2179 | bh_unlock_sock(sk); |
2174 | continue; | 2180 | continue; |
2175 | } | 2181 | } |