tty: Use spin_lock() inside existing critical region
authorPeter Hurley <peter@hurleysoftware.com>
Wed, 6 Mar 2013 12:20:55 +0000 (07:20 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Mar 2013 21:02:32 +0000 (14:02 -0700)
The interrupt state does not need to be saved, disabled and
restored here; interrupts are already off because this lock
is bracketed by spin_lock_irq/spin_unlock_irq.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c

index fb50442fd2a42c5663bb410dbd76c8db0b98fbdd..2661e86a2272b26425a7db759c277c610508ce35 100644 (file)
@@ -545,7 +545,6 @@ EXPORT_SYMBOL_GPL(tty_wakeup);
 static int tty_signal_session_leader(struct tty_struct *tty)
 {
        struct task_struct *p;
-       unsigned long flags;
        int refs = 0;
 
        read_lock(&tasklist_lock);
@@ -565,10 +564,10 @@ static int tty_signal_session_leader(struct tty_struct *tty)
                        __group_send_sig_info(SIGHUP, SEND_SIG_PRIV, p);
                        __group_send_sig_info(SIGCONT, SEND_SIG_PRIV, p);
                        put_pid(p->signal->tty_old_pgrp);  /* A noop */
-                       spin_lock_irqsave(&tty->ctrl_lock, flags);
+                       spin_lock(&tty->ctrl_lock);
                        if (tty->pgrp)
                                p->signal->tty_old_pgrp = get_pid(tty->pgrp);
-                       spin_unlock_irqrestore(&tty->ctrl_lock, flags);
+                       spin_unlock(&tty->ctrl_lock);
                        spin_unlock_irq(&p->sighand->siglock);
                } while_each_pid_task(tty->session, PIDTYPE_SID, p);
        }