From: Arnd Bergmann on
From: Arnd Bergmann <arnd(a)relay.de.ibm.com>

This avoids having to annotate every mutex_lock(&tty_mutex)
as mutex_lock_tty.

Signed-off-by: Arnd Bergmann <arnd(a)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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/