aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorOkash Khawaja <okash.khawaja@gmail.com>2017-07-16 05:28:21 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-18 03:03:21 -0400
commit216ce2962089b6218708bf87d96e6b1fbadba1d7 (patch)
tree75cc79d83508d76062902a0bb3b68c03c32c9327 /drivers
parent740c433ec35187b45abe08bb6c45a321a791be8e (diff)
staging: speakup: safely close tty
Speakup opens tty using tty_open_by_driver. When closing, it calls tty_ldisc_release but doesn't close and remove the tty itself. As a result, that tty cannot be opened from user space. This patch calls tty_release_struct which ensures that tty is safely removed and freed up. It also calls tty_ldisc_release, so speakup doesn't need to call it. Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/speakup/spk_ttyio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/speakup/spk_ttyio.c b/drivers/staging/speakup/spk_ttyio.c
index ed8e96b06ead..924034a3de4b 100644
--- a/drivers/staging/speakup/spk_ttyio.c
+++ b/drivers/staging/speakup/spk_ttyio.c
@@ -300,7 +300,7 @@ void spk_ttyio_release(void)
300 300
301 tty_ldisc_flush(speakup_tty); 301 tty_ldisc_flush(speakup_tty);
302 tty_unlock(speakup_tty); 302 tty_unlock(speakup_tty);
303 tty_ldisc_release(speakup_tty); 303 tty_release_struct(speakup_tty, speakup_tty->index);
304} 304}
305EXPORT_SYMBOL_GPL(spk_ttyio_release); 305EXPORT_SYMBOL_GPL(spk_ttyio_release);
306 306