Commit 2f507cd9 authored by Joakim Andersson's avatar Joakim Andersson Committed by Anas Nashif
Browse files

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: default avatarJoakim Andersson <joakim.andersson@nordicsemi.no>
parent 5ccd5c75
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2095,18 +2095,18 @@ static void att_reset(struct bt_att *att)
{
	struct bt_att_req *req, *tmp;
	int i;
#if CONFIG_BT_ATT_PREPARE_COUNT > 0
	struct net_buf *buf;

#if CONFIG_BT_ATT_PREPARE_COUNT > 0
	/* Discard queued buffers */
	while ((buf = k_fifo_get(&att->prep_queue, K_NO_WAIT))) {
		net_buf_unref(buf);
	}
#endif /* CONFIG_BT_ATT_PREPARE_COUNT > 0 */

	while ((buf = k_fifo_get(&att->tx_queue, K_NO_WAIT))) {
		net_buf_unref(buf);
	}
#endif

	atomic_set_bit(att->flags, ATT_DISCONNECTED);