Re: [PATCH 2/2] Bluetooth: Reorder HCI user channel socket release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Loic,

> 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@xxxxxxxxx>
> ---
> net/bluetooth/hci_sock.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

patch has been applied to bluetooth-next tree.

> diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
> index 56f9edb..e1beb4e 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);

However I still do not remember why I did it the other way around in the first place. Can someone please double check that this will not break anything. I do not trust my own judgment in this case. It feels suspicious.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux