]> git.baikalelectronics.ru Git - kernel.git/commit
serial_core: Fix race in uart_handle_dcd_change
authorAlan Cox <alan@linux.intel.com>
Wed, 19 Sep 2012 14:35:46 +0000 (15:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Sep 2012 16:51:09 +0000 (09:51 -0700)
commitf6dcdc2061eb312f277526451e54502bd3a8173e
treecbfe2836fa83eacbb4f08f31cb982fa20c8a8d80
parent202c6581b3f88d4577239ae236cc12dfe5e70a22
serial_core: Fix race in uart_handle_dcd_change

If a serial driver is called post hangup with a second DCD event then we
will attempt to get the ldisc of NULL. Check we have a tty before trying to
do anything with it.

This is still only safe within the uart layer if the caller holds the
relevant uart locks. We could do with a version where the tty is passed for
more general use.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c