Skip to content

Commit

Permalink
Bluetooth: Reorder HCI user channel socket release
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Loic Poulain authored and Marcel Holtmann committed Jun 6, 2015
1 parent 951b6a0 commit 9380f9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/bluetooth/hci_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9380f9e

Please sign in to comment.