tty-ldisc: be more careful in 'put_ldisc' locking
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 3 Aug 2009 21:54:56 +0000 (14:54 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 4 Aug 2009 20:46:30 +0000 (13:46 -0700)
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: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@mail.by>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

No differences found