Bluetooth: AMP: Drop packets when no l2cap conn exist
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Mon, 15 Oct 2012 08:58:41 +0000 (11:58 +0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Mon, 15 Oct 2012 12:47:11 +0000 (09:47 -0300)
High Speed hci_conn should always have l2cap_conn associated with it.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/l2cap_core.c

index 8faa3121bb44a7c2d54bf9785582b05f8fa9edb8..99176730bf2cb3c1c8e7b402c49e809a41837893 100644 (file)
@@ -5571,6 +5571,10 @@ int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)
        struct l2cap_hdr *hdr;
        int len;
 
+       /* For AMP controller do not create l2cap conn */
+       if (!conn && hcon->hdev->dev_type != HCI_BREDR)
+               goto drop;
+
        if (!conn)
                conn = l2cap_conn_add(hcon, 0);