Skip to content

Commit 0575e71

Browse files
alwa-nordicrlubos
authored andcommitted
Revert "[nrf noup] bluetooth: conn: Allow for an extra ref in bt_l2cap_send_pdu"
This reverts commit 685c53a. Signed-off-by: Aleksander Wasaznik <[email protected]>
1 parent 7eddcac commit 0575e71

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

subsys/bluetooth/host/conn.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -698,13 +698,7 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf,
698698

699699
uint16_t frag_len = MIN(conn_mtu(conn), len);
700700

701-
if (buf->ref > 1 + (cb ? 1 : 0)) {
702-
/* Allow for an additional buffer reference if callback is provided.
703-
* This can be used to extend lifetime of the net buffer until the
704-
* data transmission is confirmed by ACK of the remote.
705-
*/
706-
__ASSERT_NO_MSG(false);
707-
}
701+
__ASSERT_NO_MSG(buf->ref == 1);
708702

709703
if (buf->len > frag_len) {
710704
LOG_DBG("keep %p around", buf);

subsys/bluetooth/host/l2cap.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -735,17 +735,13 @@ int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu,
735735
return -ENOTCONN;
736736
}
737737

738-
/* Allow for an additional buffer reference if callback is provided. This can be used to
739-
* extend lifetime of the net buffer until the data transmission is confirmed by ACK of the
740-
* remote.
741-
*/
742-
if (pdu->ref > 1 + (cb ? 1 : 0)) {
738+
if (pdu->ref != 1) {
743739
/* The host may alter the buf contents when fragmenting. Higher
744740
* layers cannot expect the buf contents to stay intact. Extra
745741
* refs suggests a silent data corruption would occur if not for
746742
* this error.
747743
*/
748-
LOG_ERR("Expecting up to %d refs, got %d", cb ? 2 : 1, pdu->ref);
744+
LOG_ERR("Expecting 1 ref, got %d", pdu->ref);
749745
return -EINVAL;
750746
}
751747

0 commit comments

Comments
 (0)