From: Andrei Emeltchenko Date: Mon, 19 Dec 2011 14:31:29 +0000 (+0200) Subject: Bluetooth: Check for flow control mode X-Git-Tag: firefly_0821_release~3680^2~3734^2~13^2~6^2~35 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=32ac5b9b57ef521470f930fd00849be4705bc134;p=firefly-linux-kernel-4.4.55.git Bluetooth: Check for flow control mode Signed-off-by: Andrei Emeltchenko Acked-by: Marcel Holtmann Signed-off-by: Gustavo F. Padovan --- diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index da4e17f4a7c6..5a204aefc035 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -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;