Skip to content

Commit 2c5a249

Browse files
Thalleycarlescufi
authored andcommitted
Bluetooth: BAP: Add guard before accessing qos->latency
The qos->latency is not available for broadcast sink-only builds. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
1 parent 32e8392 commit 2c5a249

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

subsys/bluetooth/audio/bap_stream.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,13 @@ enum bt_bap_ascs_reason bt_audio_verify_qos(const struct bt_codec_qos *qos)
160160
return BT_BAP_ASCS_REASON_SDU;
161161
}
162162

163+
#if defined(CONFIG_BT_BAP_BROADCAST_SOURCE) || defined(CONFIG_BT_BAP_UNICAST)
163164
if (qos->latency < BT_ISO_LATENCY_MIN ||
164165
qos->latency > BT_ISO_LATENCY_MAX) {
165166
LOG_DBG("Invalid Latency %u", qos->latency);
166167
return BT_BAP_ASCS_REASON_LATENCY;
167168
}
169+
#endif /* CONFIG_BT_BAP_BROADCAST_SOURCE || CONFIG_BT_BAP_UNICAST */
168170

169171
if (qos->pd > BT_AUDIO_PD_MAX) {
170172
LOG_DBG("Invalid presentation delay %u", qos->pd);

0 commit comments

Comments
 (0)