linux-sg2042/net/bluetooth/rfcomm
Peter Hurley c949c224cf Bluetooth: Fix RFCOMM tty teardown race
RFCOMM tty device teardown can race with new tty device registration
for the same device id:

CPU 0                           | CPU 1
rfcomm_dev_add                  | rfcomm_dev_destruct
                                |   spin_lock
                                |   list_del   <== dev_id no longer used
                                |   spin_unlock
  spin_lock                     |     .
  [search rfcomm_dev_list]      |     .
  [dev_id not in use]           |     .
  [initialize new rfcomm_dev]   |     .
  spin_unlock                   |     .
                                |     .
  tty_port_register_device      |   tty_unregister_device

Don't remove rfcomm_dev from the device list until after tty device
unregistration has completed.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Tested-By: Alexander Holler <holler@ahsoftware.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-02-14 13:39:30 -08:00
..
Kconfig tty: Added a CONFIG_TTY option to allow removal of TTY 2013-01-18 16:15:27 -08:00
Makefile [Bluetooth] Move CRC table into RFCOMM core 2005-10-28 19:20:36 +02:00
core.c Bluetooth: Handle security level 4 for RFCOMM connections 2014-02-13 09:51:35 +02:00
sock.c Bluetooth: Refuse peer RFCOMM address reading when not connected 2014-02-13 09:51:39 +02:00
tty.c Bluetooth: Fix RFCOMM tty teardown race 2014-02-14 13:39:30 -08:00