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 <jonathan.rico@nordicsemi.no>
This commit is contained in:
parent
becf4c1c81
commit
0794b22c9c
|
@ -2017,7 +2017,7 @@ static int l2cap_chan_le_send_sdu(struct bt_l2cap_le_chan *ch,
|
|||
sent += ret;
|
||||
|
||||
/* If the current buffer has been fully consumed, destroy it */
|
||||
if (ret == rem_len) {
|
||||
if (sent == rem_len) {
|
||||
net_buf_unref(buf);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue