From 34e1692e4db0a5fdee5774344e84a55ccaaee05b Mon Sep 17 00:00:00 2001 From: Lang Xie Date: Tue, 5 Nov 2024 10:27:39 +0100 Subject: [PATCH] [nrf fromlist] 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. Upstream PR #: 80911 Signed-off-by: Lang Xie --- 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 1e3850fd591..69197326df2 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -2557,6 +2557,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. */