diff options
-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; |