diff options
author | Loic Poulain <loic.poulain@intel.com> | 2015-05-21 14:46:41 (GMT) |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-06-06 18:49:04 (GMT) |
commit | 9380f9eacfbbee701daa416edd6625efcd3e29e1 (patch) | |
tree | 515dd51fa977289b372207dc25c090ea932cc699 | |
parent | 951b6a0717db97ce420547222647bcc40bf1eacd (diff) | |
download | linux-9380f9eacfbbee701daa416edd6625efcd3e29e1.tar.xz |
Bluetooth: Reorder HCI user channel socket release
The hci close method needs to know if we are in user channel context.
Only add the index to mgmt once close is performed.
Signed-off-by: Loic Poulain <loic.poulain@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | net/bluetooth/hci_sock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 5b14dca..9467545 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c @@ -503,9 +503,9 @@ static int hci_sock_release(struct socket *sock) if (hdev) { if (hci_pi(sk)->channel == HCI_CHANNEL_USER) { - mgmt_index_added(hdev); - hci_dev_clear_flag(hdev, HCI_USER_CHANNEL); hci_dev_close(hdev->id); + hci_dev_clear_flag(hdev, HCI_USER_CHANNEL); + mgmt_index_added(hdev); } atomic_dec(&hdev->promisc); |