Skip to content

Commit 9844851

Browse files
Thalleykartben
authored andcommitted
Bluetooth: BAP: SD: Fix missing clear of notify flag on reject
For add and modify source, if the request was rejected by the application layer, the BASS_RECV_STATE_INTERNAL_FLAG_NOTIFY_PEND would be set but not unset. Add unsetting the flag on reject. Signed-off-by: Emil Gydesen <[email protected]>
1 parent f630c6f commit 9844851

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

subsys/bluetooth/audio/bap_scan_delegator.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,9 @@ static int scan_delegator_add_source(struct bt_conn *conn,
679679
LOG_DBG("PA sync %u from %p was rejected with reason %d", pa_sync, conn,
680680
err);
681681

682+
atomic_clear_bit(internal_state->flags,
683+
BASS_RECV_STATE_INTERNAL_FLAG_NOTIFY_PEND);
684+
682685
return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED);
683686
}
684687
}
@@ -875,6 +878,9 @@ static int scan_delegator_mod_src(struct bt_conn *conn,
875878
LOG_DBG("PA sync %u from %p was rejected with reason %d", pa_sync, conn,
876879
err);
877880

881+
atomic_clear_bit(internal_state->flags,
882+
BASS_RECV_STATE_INTERNAL_FLAG_NOTIFY_PEND);
883+
878884
return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED);
879885
}
880886
} else if (pa_sync == BT_BAP_BASS_PA_REQ_NO_SYNC &&
@@ -886,6 +892,9 @@ static int scan_delegator_mod_src(struct bt_conn *conn,
886892
if (err != 0) {
887893
LOG_DBG("PA sync term from %p was rejected with reason %d", conn, err);
888894

895+
atomic_clear_bit(internal_state->flags,
896+
BASS_RECV_STATE_INTERNAL_FLAG_NOTIFY_PEND);
897+
889898
return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED);
890899
}
891900

0 commit comments

Comments
 (0)