diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-03-06 07:20:55 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-15 17:02:32 -0400 |
commit | bc30c3b23bb953fc6eb59e7ac6ecb48d92962bb0 (patch) | |
tree | ae741d582aa942a1f8ba1c7b4dea7e29b050980c /drivers/tty/tty_io.c | |
parent | 20cc225bab6709408840e4400cd1a5c2b28c7a52 (diff) |
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: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r-- | drivers/tty/tty_io.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index fb50442fd2a4..2661e86a2272 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
@@ -545,7 +545,6 @@ EXPORT_SYMBOL_GPL(tty_wakeup); | |||
545 | static int tty_signal_session_leader(struct tty_struct *tty) | 545 | static int tty_signal_session_leader(struct tty_struct *tty) |
546 | { | 546 | { |
547 | struct task_struct *p; | 547 | struct task_struct *p; |
548 | unsigned long flags; | ||
549 | int refs = 0; | 548 | int refs = 0; |
550 | 549 | ||
551 | read_lock(&tasklist_lock); | 550 | read_lock(&tasklist_lock); |
@@ -565,10 +564,10 @@ static int tty_signal_session_leader(struct tty_struct *tty) | |||
565 | __group_send_sig_info(SIGHUP, SEND_SIG_PRIV, p); | 564 | __group_send_sig_info(SIGHUP, SEND_SIG_PRIV, p); |
566 | __group_send_sig_info(SIGCONT, SEND_SIG_PRIV, p); | 565 | __group_send_sig_info(SIGCONT, SEND_SIG_PRIV, p); |
567 | put_pid(p->signal->tty_old_pgrp); /* A noop */ | 566 | put_pid(p->signal->tty_old_pgrp); /* A noop */ |
568 | spin_lock_irqsave(&tty->ctrl_lock, flags); | 567 | spin_lock(&tty->ctrl_lock); |
569 | if (tty->pgrp) | 568 | if (tty->pgrp) |
570 | p->signal->tty_old_pgrp = get_pid(tty->pgrp); | 569 | p->signal->tty_old_pgrp = get_pid(tty->pgrp); |
571 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); | 570 | spin_unlock(&tty->ctrl_lock); |
572 | spin_unlock_irq(&p->sighand->siglock); | 571 | spin_unlock_irq(&p->sighand->siglock); |
573 | } while_each_pid_task(tty->session, PIDTYPE_SID, p); | 572 | } while_each_pid_task(tty->session, PIDTYPE_SID, p); |
574 | } | 573 | } |