diff options
author | Okash Khawaja <okash.khawaja@gmail.com> | 2017-07-16 11:28:21 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-07-18 09:03:21 +0200 |
commit | 216ce2962089b6218708bf87d96e6b1fbadba1d7 (patch) | |
tree | 75cc79d83508d76062902a0bb3b68c03c32c9327 | |
parent | staging: sm750fb: avoid conflicting vesafb (diff) | |
download | linux-216ce2962089b6218708bf87d96e6b1fbadba1d7.tar.xz linux-216ce2962089b6218708bf87d96e6b1fbadba1d7.zip |
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>
-rw-r--r-- | drivers/staging/speakup/spk_ttyio.c | 2 |
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) tty_ldisc_flush(speakup_tty); tty_unlock(speakup_tty); - tty_ldisc_release(speakup_tty); + tty_release_struct(speakup_tty, speakup_tty->index); } EXPORT_SYMBOL_GPL(spk_ttyio_release); |