Messages in this thread Patch in this message | | | From | Arnd Bergmann <> | Subject | [RFC 6/9] tty: never hold tty_lock() while getting tty_mutex | Date | Tue, 30 Mar 2010 22:56:17 +0200 |
| |
From: Arnd Bergmann <arnd@relay.de.ibm.com>
This avoids having to annotate every mutex_lock(&tty_mutex) as mutex_lock_tty.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/char/pty.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 72fb501..0a87b52 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c @@ -638,9 +638,11 @@ static int __ptmx_open(struct inode *inode, struct file *filp) if (index < 0) return index; + tty_unlock(); mutex_lock(&tty_mutex); tty = tty_init_dev(ptm_driver, index, 1); mutex_unlock(&tty_mutex); + tty_lock(); if (IS_ERR(tty)) { retval = PTR_ERR(tty); -- 1.7.0
| |