]> git.baikalelectronics.ru Git - kernel.git/commit
tty/serial: at91: fix race condition in atmel_serial_remove
authorMarek Roszko <mark.roszko@gmail.com>
Tue, 7 Jan 2014 10:45:07 +0000 (11:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jan 2014 01:10:24 +0000 (17:10 -0800)
commit06df8b78327180075a266a80001c80492ebc557d
tree569e765bd72fa61fb768a5e7e7ae0357dd5b9081
parent4e0e4acf88f28dbc896e28d469902682139bbe53
tty/serial: at91: fix race condition in atmel_serial_remove

The _remove callback could be called when a tasklet is scheduled. tasklet_kill
was called inside the function in order to free up any scheduled tasklets.
However it was called after uart_remove_one_port which destroys tty references
needed in the port for atmel_tasklet_func.
Simply putting the tasklet_kill at the start of the function will prevent this
conflict.

Signed-off-by: Marek Roszko <mark.roszko@gmail.com>
Acked-by: Leilei Zhao <leilei.zhao@atmel.com>
Cc: <stable@vger.kernel.org> # v3.12
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/atmel_serial.c