Bluetooth: clear the temporary linkkey in hci_conn_cleanup
authorAlain Michaud <alainm@chromium.org>
Thu, 2 Jun 2022 15:30:03 +0000 (15:30 +0000)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 22 Jul 2022 00:04:53 +0000 (17:04 -0700)
commit629f66aaca81ad713fb05f1d12acc827510601b3
tree5ca3eab87431eb437bf176260918513b8d9c1348
parentaf35e28f0fea877832fa27802bc862b2a912f32a
Bluetooth: clear the temporary linkkey in hci_conn_cleanup

If a hardware error occurs and the connections are flushed without a
disconnection_complete event being signaled, the temporary linkkeys are
not flushed.

This change ensures that any outstanding flushable linkkeys are flushed
when the connection are flushed from the hash table.

Additionally, this also makes use of test_and_clear_bit to avoid
multiple attempts to delete the link key that's already been flushed.

Signed-off-by: Alain Michaud <alainm@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_conn.c
net/bluetooth/hci_event.c