In net/bluetooth/rfcomm/tty.c the struct tty is used without proper
refcounting. This leads to OOPS and panics triggered by the tty layer functions
which are invoked after the struct tty has already been destroyed.
This happens for example when the bluetooth connection is lost because the host
goes down unexpectedly.
The fix uses the tty_port_* helpers already in place.
This patch depends on patch "Fix refcount leak in tty_port.c" already sent to
linux-kernel. [0]
Signed-off-by: Gianluca Anzolin <redacted>
[0] http://lkml.indiana.edu/hypermail/linux/kernel/1307.1/00600.html