From c002b1dc9ea1cef070551fc75eba9cd4909b68c5 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Wed, 23 Oct 2024 11:23:28 +0200 Subject: [PATCH] Bluetooth: Host: L2CAP: Fix seg_recv call on SDU overflow This fix calling seg_recv() callback being called even though channel is being disconnected due to SDU overflow. Signed-off-by: Szymon Janc --- subsys/bluetooth/host/l2cap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 8830d05d58a..66674b28715 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -2553,6 +2553,7 @@ static void l2cap_chan_le_recv_seg_direct(struct bt_l2cap_le_chan *chan, struct if (seg->len > sdu_remaining) { LOG_WRN("L2CAP RX PDU total exceeds SDU"); bt_l2cap_chan_disconnect(&chan->chan); + return; } /* Commit receive. */