Skip to content

Commit d391784

Browse files
ppryga-nordicmbolivar-nordic
authored andcommitted
[nrf fromtree] Bluetooth: Host: Fix wrong length of antenna identifiers for CTE RX
There were used an uninitialized variable to set antenna identifiers length. The value should be set with use of params argument, not by cp pointer that is not yet initialized. Signed-off-by: Piotr Pryga <[email protected]> (cherry picked from commit c889e34)
1 parent 76b7916 commit d391784

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/bluetooth/host/direction.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ prepare_cl_cte_rx_enable_cmd_params(struct net_buf **buf, struct bt_le_per_adv_s
282282
uint8_t switch_pattern_len;
283283

284284
if (params->cte_types & BT_DF_CTE_TYPE_AOA) {
285-
switch_pattern_len = cp->switch_pattern_len;
285+
switch_pattern_len = params->num_ant_ids;
286286
} else {
287287
switch_pattern_len = ARRAY_SIZE(df_dummy_switch_pattern);
288288
}
@@ -522,7 +522,7 @@ static int prepare_conn_cte_rx_enable_cmd_params(struct net_buf **buf, struct bt
522522
uint8_t switch_pattern_len;
523523

524524
if (params->cte_types & BT_DF_CTE_TYPE_AOA) {
525-
switch_pattern_len = cp->switch_pattern_len;
525+
switch_pattern_len = params->num_ant_ids;
526526
} else {
527527
switch_pattern_len = ARRAY_SIZE(df_dummy_switch_pattern);
528528
}

0 commit comments

Comments
 (0)