summaryrefslogtreecommitdiff
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2014-11-05 12:12:55 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-05 18:41:22 -0800
commitdeb287e7401bbbf7803731805acbda1d983d1999 (patch)
treea190857e293df1c08a6627b8c9a42f5e5f6ddbcc /drivers/tty/tty_io.c
parentd5e370a4eeb701201bd441b4ec089091dd6f2ce0 (diff)
downloadlwn-deb287e7401bbbf7803731805acbda1d983d1999.tar.gz
lwn-deb287e7401bbbf7803731805acbda1d983d1999.zip
tty: Document check_tty_count() requires tty_lock held
Holding the tty_lock() is necessary to prevent concurrent changes to the tty count that may cause it to differ from the open file list count. The tty_lock() is already held at all call sites. NB: Note that the check for the pty master tty count is safe because the slave's tty_lock() is held while decrementing the pty master tty count. Reviewed-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r--drivers/tty/tty_io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index b008e2b38d54..adbd9acf817f 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -275,6 +275,7 @@ int tty_paranoia_check(struct tty_struct *tty, struct inode *inode,
return 0;
}
+/* Caller must hold tty_lock */
static int check_tty_count(struct tty_struct *tty, const char *routine)
{
#ifdef CHECK_TTY_COUNT