tty-ldisc: be more careful in 'put_ldisc' locking
Use 'atomic_dec_and_lock()' to make sure that we always hold the tty_ldisc_lock when the ldisc count goes to zero. That way we can never race against 'tty_ldisc_try()' increasing the count again. Reported-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org> Tested-by: NSergey Senozhatsky <sergey.senozhatsky@mail.by> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
Showing
想要评论请 注册 或 登录