Bluetooth: Check for flow control mode
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Mon, 19 Dec 2011 14:31:29 +0000 (16:31 +0200)
committerGustavo F. Padovan <padovan@profusion.mobi>
Tue, 20 Dec 2011 18:59:40 +0000 (16:59 -0200)
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/hci_event.c

index da4e17f4a7c687e205fd264fb1d2073b9c60dbb3..5a204aefc035af012e2357bfc7af1a130460ce5f 100644 (file)
@@ -2263,6 +2263,11 @@ static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *s
 
        BT_DBG("%s num_hndl %d", hdev->name, ev->num_hndl);
 
+       if (hdev->flow_ctl_mode != HCI_FLOW_CTL_MODE_PACKET_BASED) {
+               BT_ERR("Wrong event for mode %d", hdev->flow_ctl_mode);
+               return;
+       }
+
        if (skb->len < ev->num_hndl * 4) {
                BT_DBG("%s bad parameters", hdev->name);
                return;