]> git.baikalelectronics.ru Git - kernel.git/commit
tty: Fix lookahead_buf crash with serdev
authorVincent Whitchurch <vincent.whitchurch@axis.com>
Thu, 18 Aug 2022 11:50:26 +0000 (13:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Aug 2022 12:31:53 +0000 (14:31 +0200)
commit86e716db57843e3829c0a90bca5b7349a7d3451f
tree796ed82646c2af26914f7027782cb3e2b02b0cdc
parenta5c2a1f334d72c164505dc26abad3dd88ac87965
tty: Fix lookahead_buf crash with serdev

Do not follow a NULL pointer if the tty_port_client_operations does not
implement the ->lookahead_buf() callback, which is the case with
serdev's ttyport.

Reported-by: Hans de Goede <hdegoede@redhat.com>
Fixes: 0813ff08692e62 ("tty: Implement lookahead to process XON/XOFF timely")
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20220818115026.2237893-1-vincent.whitchurch@axis.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_buffer.c