summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikko Rapeli <mikko.rapeli@iki.fi>2007-07-11 09:18:15 +0200
committerWilly Tarreau <w@1wt.eu>2007-08-25 17:24:16 +0200
commitb37a2fc49a6b4b0dd4fdc0434f7d7b65a3f9aa3c (patch)
treea8cdf7923e60eec625b9564f87deaa4f1436a938
parentc7127d95357001143678ac6517e8e25c2a65e4cf (diff)
downloadlwn-b37a2fc49a6b4b0dd4fdc0434f7d7b65a3f9aa3c.tar.gz
lwn-b37a2fc49a6b4b0dd4fdc0434f7d7b65a3f9aa3c.zip
[PATCH] Hangup TTY before releasing rfcomm_dev
The core problem is that RFCOMM socket layer ioctl can release rfcomm_dev struct while RFCOMM TTY layer is still actively using it. Calling tty_vhangup() is needed for a synchronous hangup before rfcomm_dev is freed. Addresses the oops at http://bugzilla.kernel.org/show_bug.cgi?id=7509 Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r--net/bluetooth/rfcomm/tty.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index eb2b52484c70..e1b866323d43 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -381,6 +381,10 @@ static int rfcomm_release_dev(void __user *arg)
if (req.flags & (1 << RFCOMM_HANGUP_NOW))
rfcomm_dlc_close(dev->dlc, 0);
+ /* Shut down TTY synchronously before freeing rfcomm_dev */
+ if (dev->tty)
+ tty_vhangup(dev->tty);
+
rfcomm_dev_del(dev);
rfcomm_dev_put(dev);
return 0;