serial: sh-sci: Stop TX DMA workqueue during port shutdown
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 6 Jul 2018 09:05:42 +0000 (11:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jul 2018 14:41:15 +0000 (16:41 +0200)
commitf661131766e45bc0b3c8b85b19676a470dc75abf
treeb4b47e57b3bd04d5ad5ec074661dbd900db00603
parent2c4ee23530ffc022dc22d2fd4b0eb039c6b4c5e9
serial: sh-sci: Stop TX DMA workqueue during port shutdown

The transmit DMA workqueue is never stopped, hence the work function may
be called after the port has been shut down.

Fix this race condition by cancelling queued work, if any, before DMA
release.  Don't initialize the work if DMA initialization failed, as it
won't be used anyway.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sh-sci.c