Files
linux/drivers
Ronald Tschalär e508e6026b Bluetooth: hci_ldisc: Fix another race when closing the tty.
[ Upstream commit 0338b1b393 ]

The following race condition still existed:

         P1                                P2
  cancel_work_sync()
                                     hci_uart_tx_wakeup()
                                     hci_uart_write_work()
                                     hci_uart_dequeue()
  clear_bit(HCI_UART_PROTO_READY)
  hci_unregister_dev(hdev)
  hci_free_dev(hdev)
  hu->proto->close(hu)
  kfree(hu)
                                     access to hdev and hu

Cancelling the work after clearing the HCI_UART_PROTO_READY bit avoids
this as any hci_uart_tx_wakeup() issued after the flag is cleared will
detect that and not schedule further work.

Signed-off-by: Ronald Tschalär <ronald@innovation.ch>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-20 10:10:29 +01:00
..
2017-12-14 09:53:13 +01:00
2017-11-03 09:02:30 -07:00
2017-12-20 10:10:28 +01:00
2017-11-03 09:02:30 -07:00
2017-12-20 10:10:23 +01:00
2017-12-17 15:07:56 +01:00