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 <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
90e3650acf
commit
f4550dbda8
1 changed files with 2 additions and 1 deletions
|
@ -1589,7 +1589,8 @@ static uint8_t primary_discover_tbs(struct bt_conn *conn, const struct bt_gatt_a
|
||||||
srv_inst->current_inst->start_handle = attr->handle + 1;
|
srv_inst->current_inst->start_handle = attr->handle + 1;
|
||||||
srv_inst->current_inst->end_handle = prim_service->end_handle;
|
srv_inst->current_inst->end_handle = prim_service->end_handle;
|
||||||
|
|
||||||
if (srv_inst->inst_cnt < CONFIG_BT_TBS_CLIENT_MAX_TBS_INSTANCES) {
|
if (CONFIG_BT_TBS_CLIENT_MAX_TBS_INSTANCES > 1 &&
|
||||||
|
srv_inst->inst_cnt < CONFIG_BT_TBS_CLIENT_MAX_TBS_INSTANCES) {
|
||||||
return BT_GATT_ITER_CONTINUE;
|
return BT_GATT_ITER_CONTINUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue