aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2013-03-06 07:20:54 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-15 17:02:32 -0400
commit20cc225bab6709408840e4400cd1a5c2b28c7a52 (patch)
tree5e722781b19e2644fe94a035e4719ed4a821842b
parentea648a47e83d7cda0832f96de215464e2c35b2c2 (diff)
tty: Fix spinlock flavor in non-atomic __tty_hangup()
__tty_hangup() and tty_vhangup() cannot be called from atomic context, so locks do not need to preserve the interrupt state (although, still disable interrupts). Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Acked-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/tty_io.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 706c23b9cb95..fb50442fd2a4 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -605,7 +605,6 @@ static void __tty_hangup(struct tty_struct *tty)
605 struct file *filp, *f = NULL; 605 struct file *filp, *f = NULL;
606 struct tty_file_private *priv; 606 struct tty_file_private *priv;
607 int closecount = 0, n; 607 int closecount = 0, n;
608 unsigned long flags;
609 int refs; 608 int refs;
610 609
611 if (!tty) 610 if (!tty)
@@ -654,7 +653,7 @@ static void __tty_hangup(struct tty_struct *tty)
654 while (refs--) 653 while (refs--)
655 tty_kref_put(tty); 654 tty_kref_put(tty);
656 655
657 spin_lock_irqsave(&tty->ctrl_lock, flags); 656 spin_lock_irq(&tty->ctrl_lock);
658 clear_bit(TTY_THROTTLED, &tty->flags); 657 clear_bit(TTY_THROTTLED, &tty->flags);
659 clear_bit(TTY_PUSH, &tty->flags); 658 clear_bit(TTY_PUSH, &tty->flags);
660 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); 659 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
@@ -663,7 +662,7 @@ static void __tty_hangup(struct tty_struct *tty)
663 tty->session = NULL; 662 tty->session = NULL;
664 tty->pgrp = NULL; 663 tty->pgrp = NULL;
665 tty->ctrl_status = 0; 664 tty->ctrl_status = 0;
666 spin_unlock_irqrestore(&tty->ctrl_lock, flags); 665 spin_unlock_irq(&tty->ctrl_lock);
667 666
668 /* 667 /*
669 * If one of the devices matches a console pointer, we 668 * If one of the devices matches a console pointer, we