diff options
author | Mikko Rapeli <mikko.rapeli@iki.fi> | 2007-07-11 03:18:15 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2007-07-11 01:01:26 -0400 |
commit | 84950cf0ba02fd6a5defe2511bc41f9aa2237632 (patch) | |
tree | e6c6d6b243d8c8d5bafdaa9d2054458409b17c82 /net/bluetooth/rfcomm | |
parent | 924f0e4a06419fa1996425d1d2512030e43acbba (diff) |
[Bluetooth] 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>
Diffstat (limited to 'net/bluetooth/rfcomm')
-rw-r--r-- | net/bluetooth/rfcomm/tty.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index b2b1cceb102a..ba469b038ea0 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
@@ -383,6 +383,10 @@ static int rfcomm_release_dev(void __user *arg) | |||
383 | if (req.flags & (1 << RFCOMM_HANGUP_NOW)) | 383 | if (req.flags & (1 << RFCOMM_HANGUP_NOW)) |
384 | rfcomm_dlc_close(dev->dlc, 0); | 384 | rfcomm_dlc_close(dev->dlc, 0); |
385 | 385 | ||
386 | /* Shut down TTY synchronously before freeing rfcomm_dev */ | ||
387 | if (dev->tty) | ||
388 | tty_vhangup(dev->tty); | ||
389 | |||
386 | rfcomm_dev_del(dev); | 390 | rfcomm_dev_del(dev); |
387 | rfcomm_dev_put(dev); | 391 | rfcomm_dev_put(dev); |
388 | return 0; | 392 | return 0; |