USB: serial: digi_acceleport: fix write-wakeup deadlocks
commit25d264a3cfa3484adb52f3fb22cbc56e0975e511
authorJohan Hovold <johan@kernel.org>
Mon, 26 Oct 2020 10:43:06 +0000 (26 11:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Jan 2021 12:35:49 +0000 (9 13:35 +0100)
tree25fcc8718e53ecdc68dace074a82a710ba599a24
parentd29f9d94b0389a23edc1b781b0f0f8ca6f8d4d75
USB: serial: digi_acceleport: fix write-wakeup deadlocks

[ Upstream commit 5098e77962e7c8947f87bd8c5869c83e000a522a ]

The driver must not call tty_wakeup() while holding its private lock as
line disciplines are allowed to call back into write() from
write_wakeup(), leading to a deadlock.

Also remove the unneeded work struct that was used to defer wakeup in
order to work around a possible race in ancient times (see comment about
n_tty write_chan() in commit 14b54e39b412 ("USB: serial: remove
changelogs and old todo entries")).

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/digi_acceleport.c