Skip to content

Commit 4bca0f3

Browse files
joerchanjhedberg
authored andcommitted
Bluetooth: ATT: Fix disconnected ATT not releasing buffers
Fix bug in ATT reset handling, not releasing queued notification buffers when the connection is terminated. Signed-off-by: Joakim Andersson <[email protected]>
1 parent 885b1ee commit 4bca0f3

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

subsys/bluetooth/host/att.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2054,18 +2054,18 @@ static void att_reset(struct bt_att *att)
20542054
{
20552055
struct bt_att_req *req, *tmp;
20562056
int i;
2057-
#if CONFIG_BT_ATT_PREPARE_COUNT > 0
20582057
struct net_buf *buf;
20592058

2059+
#if CONFIG_BT_ATT_PREPARE_COUNT > 0
20602060
/* Discard queued buffers */
20612061
while ((buf = k_fifo_get(&att->prep_queue, K_NO_WAIT))) {
20622062
net_buf_unref(buf);
20632063
}
2064+
#endif /* CONFIG_BT_ATT_PREPARE_COUNT > 0 */
20642065

20652066
while ((buf = k_fifo_get(&att->tx_queue, K_NO_WAIT))) {
20662067
net_buf_unref(buf);
20672068
}
2068-
#endif
20692069

20702070
atomic_set_bit(att->flags, ATT_DISCONNECTED);
20712071

0 commit comments

Comments
 (0)