Skip to content

Commit a17eeb2

Browse files
ppryga-nordiccarlescufi
authored andcommitted
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]>
1 parent cd89f9a commit a17eeb2

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
}
@@ -524,7 +524,7 @@ static int prepare_conn_cte_rx_enable_cmd_params(struct net_buf **buf, struct bt
524524
uint8_t switch_pattern_len;
525525

526526
if (params->cte_types & BT_DF_CTE_TYPE_AOA) {
527-
switch_pattern_len = cp->switch_pattern_len;
527+
switch_pattern_len = params->num_ant_ids;
528528
} else {
529529
switch_pattern_len = ARRAY_SIZE(df_dummy_switch_pattern);
530530
}

0 commit comments

Comments
 (0)