diff options
author | Okash Khawaja <okash.khawaja@gmail.com> | 2017-05-31 20:50:12 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-03 17:38:25 +0900 |
commit | 011cca558b6256ff14464e61c111707415a0484f (patch) | |
tree | 39ab7695404e4ad40653b348426c0f939c470bc2 /drivers/staging/speakup | |
parent | d0b112ac2ae3738a9f1a86f97dc5fbd23be7e123 (diff) | |
download | linux-stable-011cca558b6256ff14464e61c111707415a0484f.tar.gz linux-stable-011cca558b6256ff14464e61c111707415a0484f.tar.bz2 linux-stable-011cca558b6256ff14464e61c111707415a0484f.zip |
staging: speakup: check for null before calling TTY's flush_buffer
We should check the flush_buffer method of a tty for null before
invoking it. Some drivers such as usbserial don't implement
flush_buffer. This will be required for upcoming patches where we expand
spk_ttyio to support more than just ttyS*.
Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/speakup')
-rw-r--r-- | drivers/staging/speakup/spk_ttyio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/speakup/spk_ttyio.c b/drivers/staging/speakup/spk_ttyio.c index ed36240cf382..7b1eaf976f52 100644 --- a/drivers/staging/speakup/spk_ttyio.c +++ b/drivers/staging/speakup/spk_ttyio.c @@ -227,7 +227,8 @@ static unsigned char spk_ttyio_in_nowait(void) static void spk_ttyio_flush_buffer(void) { - speakup_tty->ops->flush_buffer(speakup_tty); + if (speakup_tty->ops->flush_buffer) + speakup_tty->ops->flush_buffer(speakup_tty); } int spk_ttyio_synth_probe(struct spk_synth *synth) |