Bluetooth: VCP: Return if VOCS/AICS inst count is 0

In the prepare_aics_inst and prepare_vocs_inst the loops
should not run if the count is 0.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2023-06-20 13:23:46 +02:00 committed by Carles Cufí
parent 3d53a75180
commit 92d612e79d

View File

@ -260,6 +260,10 @@ static int prepare_vocs_inst(struct bt_vcp_vol_rend_register_param *param)
int j;
int i;
if (CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT == 0) {
return 0;
}
__ASSERT(param, "NULL param");
for (j = 0, i = 0; i < ARRAY_SIZE(vcs_attrs); i++) {
@ -303,6 +307,10 @@ static int prepare_aics_inst(struct bt_vcp_vol_rend_register_param *param)
int j;
int i;
if (CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT == 0) {
return 0;
}
__ASSERT(param, "NULL param");
for (j = 0, i = 0; i < ARRAY_SIZE(vcs_attrs); i++) {