From: Gianluca Anzolin Date: Mon, 29 Jul 2013 15:08:12 +0000 (+0200) Subject: Bluetooth: Fix the reference counting of tty_port X-Git-Tag: v3.12-rc1~132^2~84^2^2~54^2~11 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ece3150dea382c7c961fe2604332ed3474960d25;p=pandora-kernel.git 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 Reviewed-by: Peter Hurley Signed-off-by: Gustavo Padovan --- Reading git-diff-tree failed