diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index d6976db02c06..cfb828452a13 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3769,7 +3769,11 @@ static void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb) struct hci_conn *conn; __u16 handle, flags; - skb_pull(skb, HCI_ACL_HDR_SIZE); + if (!skb_pull(skb, HCI_ACL_HDR_SIZE)) { + BT_ERR("ACL data packet %d, smaller than ACL HEADER Size %d\n", + skb->len, HCI_ACL_HDR_SIZE); + goto out; + } handle = __le16_to_cpu(hdr->handle); flags = hci_flags(handle); @@ -3795,6 +3799,7 @@ static void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb) handle); } +out: kfree_skb(skb); }