]> git.baikalelectronics.ru Git - kernel.git/commit
serdev: ttyport: fix tty locking in close
authorJohan Hovold <johan@kernel.org>
Fri, 3 Nov 2017 14:30:56 +0000 (15:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2017 15:00:50 +0000 (16:00 +0100)
commit9483256e2844e1d588a5b331303337cfd09fd07f
tree4d4bd460a12938f02c3811714352da6876594f8a
parentc4591a6f1963c2c2320adba8ea7112df43ec01b4
serdev: ttyport: fix tty locking in close

Make sure to hold the tty lock as required when calling tty-driver
close() (e.g. to avoid racing with hangup()).

Note that the serport active flag is currently set under the lock at
controller open, but really isn't protected by it.

Fixes: e11de4af9607 ("serdev: Introduce new bus for serial attached devices")
Signed-off-by: Johan Hovold <johan@kernel.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serdev/serdev-ttyport.c