Merge tag 'v3.12'
[firefly-linux-kernel-4.4.55.git] / drivers / tty / pty.c
index b940127ba1c89a1895ccc73e4e506beae5e88875..25c9bc7837229abc2fb527732386111fb21194f0 100644 (file)
@@ -281,7 +281,7 @@ static int pty_resize(struct tty_struct *tty,  struct winsize *ws)
        struct tty_struct *pty = tty->link;
 
        /* For a PTY we need to lock the tty side */
-       down_write(&tty->termios_rwsem);
+       mutex_lock(&tty->winsize_mutex);
        if (!memcmp(ws, &tty->winsize, sizeof(*ws)))
                goto done;
 
@@ -308,7 +308,7 @@ static int pty_resize(struct tty_struct *tty,  struct winsize *ws)
        tty->winsize = *ws;
        pty->winsize = *ws;     /* Never used so will go away soon */
 done:
-       up_write(&tty->termios_rwsem);
+       mutex_unlock(&tty->winsize_mutex);
        return 0;
 }