Commit 0794b22c authored by Jonathan Rico's avatar Jonathan Rico Committed by Alberto Escolar
Browse files

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: default avatarJonathan Rico <jonathan.rico@nordicsemi.no>
parent becf4c1c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
		}
	}