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

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: 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 ea648a47
...@@ -605,7 +605,6 @@ static void __tty_hangup(struct tty_struct *tty) ...@@ -605,7 +605,6 @@ static void __tty_hangup(struct tty_struct *tty)
struct file *filp, *f = NULL; struct file *filp, *f = NULL;
struct tty_file_private *priv; struct tty_file_private *priv;
int closecount = 0, n; int closecount = 0, n;
unsigned long flags;
int refs; int refs;
if (!tty) if (!tty)
...@@ -654,7 +653,7 @@ static void __tty_hangup(struct tty_struct *tty) ...@@ -654,7 +653,7 @@ static void __tty_hangup(struct tty_struct *tty)
while (refs--) while (refs--)
tty_kref_put(tty); tty_kref_put(tty);
spin_lock_irqsave(&tty->ctrl_lock, flags); spin_lock_irq(&tty->ctrl_lock);
clear_bit(TTY_THROTTLED, &tty->flags); clear_bit(TTY_THROTTLED, &tty->flags);
clear_bit(TTY_PUSH, &tty->flags); clear_bit(TTY_PUSH, &tty->flags);
clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
...@@ -663,7 +662,7 @@ static void __tty_hangup(struct tty_struct *tty) ...@@ -663,7 +662,7 @@ static void __tty_hangup(struct tty_struct *tty)
tty->session = NULL; tty->session = NULL;
tty->pgrp = NULL; tty->pgrp = NULL;
tty->ctrl_status = 0; tty->ctrl_status = 0;
spin_unlock_irqrestore(&tty->ctrl_lock, flags); spin_unlock_irq(&tty->ctrl_lock);
/* /*
* If one of the devices matches a console pointer, we * If one of the devices matches a console pointer, we
......
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