Commit e5499167 authored by Loic Poulain's avatar Loic Poulain Committed by Marcel Holtmann

Bluetooth: hci_uart: Fix zero len data packet reception issue

Packets with a variable length value equal to zero were not received.

Since no more data expected (and input buffer entirely consumed), we
need to complete/forward the packet immediately instead of waiting for
more data.
Signed-off-by: default avatarLoic Poulain <loic.poulain@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 4e1795de
...@@ -223,8 +223,7 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, ...@@ -223,8 +223,7 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
switch ((&pkts[i])->lsize) { switch ((&pkts[i])->lsize) {
case 0: case 0:
/* No variable data length */ /* No variable data length */
(&pkts[i])->recv(hdev, skb); dlen = 0;
skb = NULL;
break; break;
case 1: case 1:
/* Single octet variable length */ /* Single octet variable length */
...@@ -252,6 +251,12 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, ...@@ -252,6 +251,12 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
kfree_skb(skb); kfree_skb(skb);
return ERR_PTR(-EILSEQ); return ERR_PTR(-EILSEQ);
} }
if (!dlen) {
/* No more data, complete frame */
(&pkts[i])->recv(hdev, skb);
skb = NULL;
}
} else { } else {
/* Complete frame */ /* Complete frame */
(&pkts[i])->recv(hdev, skb); (&pkts[i])->recv(hdev, skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment