Skip to content

Commit ac25b93

Browse files
Vudentznashif
authored andcommitted
Bluetooth: ATT: Fix using of k_fifo_{put,get}
These functions don't work with buffers that do have fragments, instead this replaces their usage with net_buf_{put,get}. Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 9052e3e commit ac25b93

File tree

1 file changed

+5
-5
lines changed
  • subsys/bluetooth/host

1 file changed

+5
-5
lines changed

subsys/bluetooth/host/att.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ static void bt_att_chan_send_rsp(struct bt_att_chan *chan, struct net_buf *buf,
445445
err = bt_att_chan_send(chan, buf, cb);
446446
if (err) {
447447
/* Responses need to be sent back using the same channel */
448-
k_fifo_put(&chan->tx_queue, buf);
448+
net_buf_put(&chan->tx_queue, buf);
449449
}
450450
}
451451

@@ -2500,12 +2500,12 @@ static void att_reset(struct bt_att *att)
25002500

25012501
#if CONFIG_BT_ATT_PREPARE_COUNT > 0
25022502
/* Discard queued buffers */
2503-
while ((buf = k_fifo_get(&att->prep_queue, K_NO_WAIT))) {
2503+
while ((buf = net_buf_get(&att->prep_queue, K_NO_WAIT))) {
25042504
net_buf_unref(buf);
25052505
}
25062506
#endif /* CONFIG_BT_ATT_PREPARE_COUNT > 0 */
25072507

2508-
while ((buf = k_fifo_get(&att->tx_queue, K_NO_WAIT))) {
2508+
while ((buf = net_buf_get(&att->tx_queue, K_NO_WAIT))) {
25092509
net_buf_unref(buf);
25102510
}
25112511

@@ -2539,7 +2539,7 @@ static void att_chan_detach(struct bt_att_chan *chan)
25392539
}
25402540

25412541
/* Release pending buffers */
2542-
while ((buf = k_fifo_get(&chan->tx_queue, K_NO_WAIT))) {
2542+
while ((buf = net_buf_get(&chan->tx_queue, K_NO_WAIT))) {
25432543
net_buf_unref(buf);
25442544
}
25452545

@@ -2970,7 +2970,7 @@ int bt_att_send(struct bt_conn *conn, struct net_buf *buf, bt_conn_tx_cb_t cb,
29702970
if (ret < 0) {
29712971
/* Queue buffer to be send later */
29722972
BT_DBG("Queueing buffer %p", buf);
2973-
k_fifo_put(&att->tx_queue, buf);
2973+
net_buf_put(&att->tx_queue, buf);
29742974
}
29752975

29762976
return 0;

0 commit comments

Comments
 (0)