Skip to content

Commit f4550db

Browse files
Thalleycarlescufi
authored andcommitted
Bluetooth: TBS: Guard check for MAX_TBS_INSTANCES
Add check for CONFIG_BT_TBS_CLIENT_MAX_TBS_INSTANCES > 1 before comparing inst_cnt, as otherwise it was always false which caused a coverity issue. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 90e3650 commit f4550db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/bluetooth/audio/tbs_client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,8 @@ static uint8_t primary_discover_tbs(struct bt_conn *conn, const struct bt_gatt_a
15891589
srv_inst->current_inst->start_handle = attr->handle + 1;
15901590
srv_inst->current_inst->end_handle = prim_service->end_handle;
15911591

1592-
if (srv_inst->inst_cnt < CONFIG_BT_TBS_CLIENT_MAX_TBS_INSTANCES) {
1592+
if (CONFIG_BT_TBS_CLIENT_MAX_TBS_INSTANCES > 1 &&
1593+
srv_inst->inst_cnt < CONFIG_BT_TBS_CLIENT_MAX_TBS_INSTANCES) {
15931594
return BT_GATT_ITER_CONTINUE;
15941595
}
15951596
}

0 commit comments

Comments
 (0)