diff options
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index fc572795497a..3daac2c6b7b4 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <net/bluetooth/hci_core.h> | 37 | #include <net/bluetooth/hci_core.h> |
38 | #include <net/bluetooth/l2cap.h> | 38 | #include <net/bluetooth/l2cap.h> |
39 | #include <net/bluetooth/smp.h> | 39 | #include <net/bluetooth/smp.h> |
40 | #include <net/bluetooth/a2mp.h> | ||
40 | 41 | ||
41 | bool disable_ertm; | 42 | bool disable_ertm; |
42 | 43 | ||
@@ -5132,10 +5133,20 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk | |||
5132 | 5133 | ||
5133 | chan = l2cap_get_chan_by_scid(conn, cid); | 5134 | chan = l2cap_get_chan_by_scid(conn, cid); |
5134 | if (!chan) { | 5135 | if (!chan) { |
5135 | BT_DBG("unknown cid 0x%4.4x", cid); | 5136 | if (cid == L2CAP_CID_A2MP) { |
5136 | /* Drop packet and return */ | 5137 | chan = a2mp_channel_create(conn, skb); |
5137 | kfree_skb(skb); | 5138 | if (!chan) { |
5138 | return 0; | 5139 | kfree_skb(skb); |
5140 | return 0; | ||
5141 | } | ||
5142 | |||
5143 | l2cap_chan_lock(chan); | ||
5144 | } else { | ||
5145 | BT_DBG("unknown cid 0x%4.4x", cid); | ||
5146 | /* Drop packet and return */ | ||
5147 | kfree_skb(skb); | ||
5148 | return 0; | ||
5149 | } | ||
5139 | } | 5150 | } |
5140 | 5151 | ||
5141 | BT_DBG("chan %p, len %d", chan, skb->len); | 5152 | BT_DBG("chan %p, len %d", chan, skb->len); |