Bluetooth: Make handle of hci_conn be unique
authorZiyang Xuan <william.xuanziyang@huawei.com>
Wed, 11 Oct 2023 09:57:31 +0000 (17:57 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 23 Oct 2023 18:03:20 +0000 (11:03 -0700)
commit181a42edddf51d5d9697ecdf365d72ebeab5afb0
tree28decb9a44b9deb3a8c513faf1d2bef8eabc871c
parent624820f7c8826dd010e8b1963303c145f99816e9
Bluetooth: Make handle of hci_conn be unique

The handle of new hci_conn is always HCI_CONN_HANDLE_MAX + 1 if
the handle of the first hci_conn entry in hci_dev->conn_hash->list
is not HCI_CONN_HANDLE_MAX + 1. Use ida to manage the allocation of
hci_conn->handle to make it be unique.

Fixes: 9f78191cc9f1 ("Bluetooth: hci_conn: Always allocate unique handles")
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
include/net/bluetooth/hci_core.h
net/bluetooth/amp.c
net/bluetooth/hci_conn.c
net/bluetooth/hci_core.c
net/bluetooth/hci_event.c