linux/include/net/bluetooth
Peter Hurley 80ea73378a Bluetooth: Fix unreleased rfcomm_dev reference
When RFCOMM_RELEASE_ONHUP is set, the rfcomm tty driver 'takes over'
the initial rfcomm_dev reference created by the RFCOMMCREATEDEV ioctl.
The assumption is that the rfcomm tty driver will release the
rfcomm_dev reference when the tty is freed (in rfcomm_tty_cleanup()).
However, if the tty is never opened, the 'take over' never occurs,
so when RFCOMMRELEASEDEV ioctl is called, the reference is not
released.

Track the state of the reference 'take over' so that the release
is guaranteed by either the RFCOMMRELEASEDEV ioctl or the rfcomm tty
driver.

Note that the synchronous hangup in rfcomm_release_dev() ensures
that rfcomm_tty_install() cannot race with the RFCOMMRELEASEDEV ioctl.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Tested-By: Alexander Holler <holler@ahsoftware.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
History 2014-02-14 13:39:29 -08:00
..
bluetooth.h Bluetooth: Introduce requirements for security level 4 2014-02-13 09:51:35 +02:00
hci.h Bluetooth: Add constants for LTK key types 2014-02-13 09:51:44 +02:00
hci_core.h Bluetooth: Introduce connection parameters list 2014-02-13 09:51:44 +02:00
hci_mon.h Bluetooth: Fix coding style in all .h files 2012-03-07 00:04:25 -03:00
l2cap.h Bluetooth: Enable LE L2CAP CoC support by default 2014-02-14 13:39:12 -08:00
mgmt.h Bluetooth: Rename authentication to key_type in mgmt_ltk_info 2014-02-13 09:51:43 +02:00
rfcomm.h Bluetooth: Fix unreleased rfcomm_dev reference 2014-02-14 13:39:29 -08:00
sco.h Bluetooth: Store SCO address information in its own socket structure 2013-10-13 21:11:20 +03:00