Skip to content

Commit 8ea7c45

Browse files
olivier-le-sagerlubos
authored andcommitted
[nrf fromtree] bluetooth: host: Handle failure to disable scan when updating own_addr
It wasn't taken into account that bt_le_scan_set_enable() has a return value. It's not likely that the controller rejects the command when BT_DEV_SCANNING is set, however. Signed-off-by: Olivier Lesage <[email protected]> (cherry picked from commit aa4e6ac)
1 parent 8f08163 commit 8ea7c45

File tree

1 file changed

+2
-2
lines changed
  • subsys/bluetooth/host

1 file changed

+2
-2
lines changed

subsys/bluetooth/host/id.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2181,8 +2181,8 @@ int bt_id_set_adv_own_addr(struct bt_le_ext_adv *adv, uint32_t options,
21812181
if (!IS_ENABLED(CONFIG_BT_PRIVACY) &&
21822182
!IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY) &&
21832183
dev_scanning) {
2184-
scan_disabled = true;
2185-
bt_le_scan_set_enable(BT_HCI_LE_SCAN_DISABLE);
2184+
err = bt_le_scan_set_enable(BT_HCI_LE_SCAN_DISABLE);
2185+
scan_disabled = err == 0;
21862186
}
21872187

21882188
/* If we are scanning with the identity address, it does

0 commit comments

Comments
 (0)