Bluetooth: Audio: Unicast client missing unref on ACL disconnected

The unicast client takes a reference to the ACL, but did
not return the reference when the ACL disconnected, but
rather just reset everything.

Modified to detach the stream, ensuring
a bt_conn_unref on ACL disconnect.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2022-03-29 14:05:21 +02:00 committed by Marti Bolivar
parent 6d98a1cc7e
commit 5d18f93561

View file

@ -264,10 +264,12 @@ void bt_audio_stream_reset(struct bt_audio_stream *stream)
BT_DBG("stream %p", stream);
if (stream == NULL || stream->conn == NULL) {
if (stream == NULL) {
return;
}
bt_audio_stream_detach(stream);
err = bt_audio_cig_terminate(stream);
if (err != 0) {
BT_ERR("Failed to terminate CIG: %d", err);