Skip to content

Commit e549916

Browse files
Loic Poulainholtmann
authored andcommitted
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: Loic Poulain <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 4e1795d commit e549916

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/bluetooth/hci_h4.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,7 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
223223
switch ((&pkts[i])->lsize) {
224224
case 0:
225225
/* No variable data length */
226-
(&pkts[i])->recv(hdev, skb);
227-
skb = NULL;
226+
dlen = 0;
228227
break;
229228
case 1:
230229
/* Single octet variable length */
@@ -252,6 +251,12 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
252251
kfree_skb(skb);
253252
return ERR_PTR(-EILSEQ);
254253
}
254+
255+
if (!dlen) {
256+
/* No more data, complete frame */
257+
(&pkts[i])->recv(hdev, skb);
258+
skb = NULL;
259+
}
255260
} else {
256261
/* Complete frame */
257262
(&pkts[i])->recv(hdev, skb);

0 commit comments

Comments
 (0)