Skip to content

Commit 4c52d3d

Browse files
committed
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
2 parents 8a7d7cb + 4c02e2d commit 4c52d3d

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

net/bluetooth/hci_conn.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ static void hci_conn_disconnect(struct hci_conn *conn)
249249
__u8 reason = hci_proto_disconn_ind(conn);
250250

251251
switch (conn->type) {
252-
case ACL_LINK:
253-
hci_acl_disconn(conn, reason);
254-
break;
255252
case AMP_LINK:
256253
hci_amp_disconn(conn, reason);
257254
break;
255+
default:
256+
hci_acl_disconn(conn, reason);
257+
break;
258258
}
259259
}
260260

net/bluetooth/smp.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,19 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb)
859859

860860
skb_pull(skb, sizeof(code));
861861

862+
/*
863+
* The SMP context must be initialized for all other PDUs except
864+
* pairing and security requests. If we get any other PDU when
865+
* not initialized simply disconnect (done if this function
866+
* returns an error).
867+
*/
868+
if (code != SMP_CMD_PAIRING_REQ && code != SMP_CMD_SECURITY_REQ &&
869+
!conn->smp_chan) {
870+
BT_ERR("Unexpected SMP command 0x%02x. Disconnecting.", code);
871+
kfree_skb(skb);
872+
return -ENOTSUPP;
873+
}
874+
862875
switch (code) {
863876
case SMP_CMD_PAIRING_REQ:
864877
reason = smp_cmd_pairing_req(conn, skb);

0 commit comments

Comments
 (0)