mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 11:49:32 +00:00
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>
This commit is contained in:
parent
d0b112ac2a
commit
011cca558b
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue