From 994246f7c6742555aee899ed853a91bc77686022 Mon Sep 17 00:00:00 2001 From: ZhongYao Luo Date: Tue, 3 Dec 2019 17:33:07 +0800 Subject: [PATCH] bluetooth: h5: Handling the the zero length ack packet If H5_HDR_LEN is equal to zero, remaining will grow negatively, the commit fixes the problem. Signed-off-by: ZhongYao Luo --- drivers/bluetooth/hci/h5.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/bluetooth/hci/h5.c b/drivers/bluetooth/hci/h5.c index a38ccc5b2b2..bab17b87c28 100644 --- a/drivers/bluetooth/hci/h5.c +++ b/drivers/bluetooth/hci/h5.c @@ -501,6 +501,9 @@ static void bt_uart_isr(struct device *unused) h5.rx_state = END; break; } + if (!remaining) { + h5.rx_state = END; + } break; case PAYLOAD: if (h5_unslip_byte(&byte) < 0) {