Bluetooth: MGMT: Fix MGMT_OP_ADD_DEVICE invalid device flags
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 29 Apr 2025 19:05:59 +0000 (15:05 -0400)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 7 May 2025 16:47:53 +0000 (12:47 -0400)
commit1e2e3044c1bc64a64aa0eaf7c17f7832c26c9775
treea626ddaf07b7d115f9ca128b659dfb33d882d574
parent9540984da649d46f699c47f28c68bbd3c9d99e4c
Bluetooth: MGMT: Fix MGMT_OP_ADD_DEVICE invalid device flags

Device flags could be updated in the meantime while MGMT_OP_ADD_DEVICE
is pending on hci_update_passive_scan_sync so instead of setting the
current_flags as cmd->user_data just do a lookup using
hci_conn_params_lookup and use the latest stored flags.

Fixes: a182d9c84f9c ("Bluetooth: MGMT: Fix Add Device to responding before completing")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/mgmt.c