lkml.org 
[lkml]   [2017]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Bluetooth: hci_ldisc: Fix another race when closing the tty.
On Wed, Oct 25, 2017 at 10:15:19PM -0700, =?UTF-8?q?Ronald=20Tschal=C3=A4r?= wrote:
> --- a/drivers/bluetooth/hci_ldisc.c
> +++ b/drivers/bluetooth/hci_ldisc.c
> @@ -523,13 +523,13 @@ static void hci_uart_tty_close(struct tty_struct *tty)
> if (hdev)
> hci_uart_close(hdev);
>
> - cancel_work_sync(&hu->write_work);
> -
> if (test_bit(HCI_UART_PROTO_READY, &hu->flags)) {
> percpu_down_write(&hu->proto_lock);
> clear_bit(HCI_UART_PROTO_READY, &hu->flags);
> percpu_up_write(&hu->proto_lock);
>
> + cancel_work_sync(&hu->write_work);
> +

Now the work is only cancelled if HCI_UART_PROTO_READY is set,
but that seems fine, so

Reviewed-by: Lukas Wunner <lukas@wunner.de>

It should be noted that this patch only applies cleanly if Ronald's
other patch is applied before.

\
 
 \ /
  Last update: 2017-10-26 08:52    [W:0.036 / U:3.912 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site