Commit bc30c3b2 authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

tty: Use spin_lock() inside existing critical region

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: default avatarPeter Hurley <peter@hurleysoftware.com>
Acked-by: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 20cc225b
...@@ -545,7 +545,6 @@ EXPORT_SYMBOL_GPL(tty_wakeup); ...@@ -545,7 +545,6 @@ EXPORT_SYMBOL_GPL(tty_wakeup);
static int tty_signal_session_leader(struct tty_struct *tty) static int tty_signal_session_leader(struct tty_struct *tty)
{ {
struct task_struct *p; struct task_struct *p;
unsigned long flags;
int refs = 0; int refs = 0;
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
...@@ -565,10 +564,10 @@ static int tty_signal_session_leader(struct tty_struct *tty) ...@@ -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(SIGHUP, SEND_SIG_PRIV, p);
__group_send_sig_info(SIGCONT, SEND_SIG_PRIV, p); __group_send_sig_info(SIGCONT, SEND_SIG_PRIV, p);
put_pid(p->signal->tty_old_pgrp); /* A noop */ put_pid(p->signal->tty_old_pgrp); /* A noop */
spin_lock_irqsave(&tty->ctrl_lock, flags); spin_lock(&tty->ctrl_lock);
if (tty->pgrp) if (tty->pgrp)
p->signal->tty_old_pgrp = get_pid(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); spin_unlock_irq(&p->sighand->siglock);
} while_each_pid_task(tty->session, PIDTYPE_SID, p); } while_each_pid_task(tty->session, PIDTYPE_SID, p);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment