Skip to content

Commit 241c81c

Browse files
jakkrambolivar-nordic
authored andcommitted
[nrf fromtree] Bluetooth: Host: Fix invalid sync term callback params
When using periodic advertising list and receiving hci_le_per_adv_sync_established event from controller with an error code the bt_le_per_adv_sync_term_info would be incorrectly populated with le_addr and sid. This is because the current pending advertising sync object is not populated with any le_addr and sid from bt_le_per_adv_sync_create as those are not used when option BT_LE_PER_ADV_SYNC_OPT_USE_PER_ADV_LIST is set. Instead the bt_le_per_adv_sync_term_info shall be populated with the le_addr and sid coming in the event from controller. Signed-off-by: Jakob Krantz <[email protected]> Signed-off-by: Herman Berget <[email protected]> (cherry picked from commit b26dbbb)
1 parent ef967e3 commit 241c81c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/bluetooth/host/scan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,8 @@ void bt_hci_le_per_adv_sync_established(struct net_buf *buf)
907907
struct bt_le_per_adv_sync_term_info term_info;
908908

909909
/* Terminate the pending PA sync and notify app */
910-
term_info.addr = &pending_per_adv_sync->addr;
911-
term_info.sid = pending_per_adv_sync->sid;
910+
term_info.addr = &evt->adv_addr;
911+
term_info.sid = evt->sid;
912912
term_info.reason = unexpected_evt ? BT_HCI_ERR_UNSPECIFIED : evt->status;
913913

914914
/* Deleting before callback, so the caller will be able

0 commit comments

Comments
 (0)