Skip to content

Commit

Permalink
Bluetooth: CAP: Add null check for free_conn
Browse files Browse the repository at this point in the history
When populating the conns array in
bt_cap_initiator_codec_configured, coverity did not like just
having the __ASSERT, so modified the checks.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
  • Loading branch information
Thalley authored and carlescufi committed Jun 30, 2023
1 parent 4e15a09 commit f1a3b7d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions subsys/bluetooth/audio/cap_initiator.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,11 @@ void bt_cap_initiator_codec_configured(struct bt_cap_stream *cap_stream)
continue;
}

__ASSERT(free_conn, "No free conns");
*free_conn = stream_conn;
if (free_conn != NULL) {
*free_conn = stream_conn;
} else {
__ASSERT_PRINT("No free conns");
}
}

/* All streams in the procedure share the same unicast group, so we just
Expand Down

0 comments on commit f1a3b7d

Please sign in to comment.