Commit 011cca55 authored by Okash Khawaja's avatar Okash Khawaja Committed by Greg Kroah-Hartman
Browse files

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: default avatarOkash Khawaja <okash.khawaja@gmail.com>
Reviewed-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d0b112ac
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -227,6 +227,7 @@ static unsigned char spk_ttyio_in_nowait(void)

static void spk_ttyio_flush_buffer(void)
{
	if (speakup_tty->ops->flush_buffer)
		speakup_tty->ops->flush_buffer(speakup_tty);
}