linux/net/bluetooth
Gianluca Anzolin ece3150dea Bluetooth: Fix the reference counting of tty_port
The tty_port can be released in two cases: when we get a HUP in the
functions rfcomm_tty_hangup() and rfcomm_dev_state_change(). Or when the
user releases the device in rfcomm_release_dev().

In these cases we set the flag RFCOMM_TTY_RELEASED so that no other
function can get a reference to the tty_port.
The use of !test_and_set_bit(RFCOMM_TTY_RELEASED) ensures that the
'initial' tty_port reference is only dropped once.

The rfcomm_dev_del function is removed becase it isn't used anymore.

Signed-off-by: Gianluca Anzolin <gianluca@sottospazio.it>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
2013-08-21 16:47:07 +02:00
..
bnep Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-05-01 17:51:54 -07:00
cmtp Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-05-01 17:51:54 -07:00
hidp Bluetooth: hidp: remove wrong send_report at init 2013-07-25 14:15:24 +01:00
rfcomm Bluetooth: Fix the reference counting of tty_port 2013-08-21 16:47:07 +02:00
a2mp.c Bluetooth: Replaced kzalloc and memcpy with kmemdup 2013-03-18 14:01:50 -03:00
af_bluetooth.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-05-01 17:51:54 -07:00
amp.c Bluetooth: AMP: Use set_bit / test_bit for amp_mgr state 2013-01-09 17:05:05 -02:00
hci_conn.c Bluetooth: introduce hci_conn ref-counting 2013-04-17 02:45:22 -03:00
hci_core.c Bluetooth: Set different event mask for LE-only controllers 2013-08-21 16:47:05 +02:00
hci_event.c Bluetooth: Use defines instead of integer literals 2013-07-25 14:15:23 +01:00
hci_sock.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-05-01 17:51:54 -07:00
hci_sysfs.c Bluetooth: Track feature pages in a single table 2013-04-18 00:26:20 -03:00
Kconfig Bluetooth: trivial: Remove newline before EOF 2012-10-24 00:42:47 -02:00
l2cap_core.c Bluetooth: Add missing braces to an "else if" 2013-07-25 14:15:23 +01:00
l2cap_sock.c Bluetooth: Rename L2CAP_CID_LE_DATA to L2CAP_CID_ATT 2013-06-23 00:23:47 +01:00
lib.c bluetooth: Remove unneeded batostr function 2012-09-27 18:10:43 -03:00
Makefile Bluetooth: AMP: Use HCI cmd to Read Loc AMP Assoc 2012-09-27 17:10:32 -03:00
mgmt.c Bluetooth: Remove unneeded flag 2013-06-23 00:23:53 +01:00
sco.c Bluetooth: Fix getting SCO socket options in deferred state 2013-08-21 16:47:04 +02:00
smp.c Bluetooth: Fix checks for LE support on LE-only controllers 2013-06-12 10:20:54 -04:00