Skip to content

Commit 0794b22

Browse files
jori-nordicaescolar
authored andcommitted
Bluetooth: l2cap: Fix SDU buffer leak
`ret` is the amount sent from the current buffer. `sent` contains the total amount that was transferred in the while loop. Signed-off-by: Jonathan Rico <[email protected]>
1 parent becf4c1 commit 0794b22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/bluetooth/host/l2cap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,7 @@ static int l2cap_chan_le_send_sdu(struct bt_l2cap_le_chan *ch,
20172017
sent += ret;
20182018

20192019
/* If the current buffer has been fully consumed, destroy it */
2020-
if (ret == rem_len) {
2020+
if (sent == rem_len) {
20212021
net_buf_unref(buf);
20222022
}
20232023
}

0 commit comments

Comments
 (0)