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

tty: Fix unsafe bit ops in tty_throttle_safe/unthrottle_safe

tty->flags needs to be atomically modified.
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 31815c08
...@@ -156,7 +156,7 @@ int tty_throttle_safe(struct tty_struct *tty) ...@@ -156,7 +156,7 @@ int tty_throttle_safe(struct tty_struct *tty)
if (tty->flow_change != TTY_THROTTLE_SAFE) if (tty->flow_change != TTY_THROTTLE_SAFE)
ret = 1; ret = 1;
else { else {
__set_bit(TTY_THROTTLED, &tty->flags); set_bit(TTY_THROTTLED, &tty->flags);
if (tty->ops->throttle) if (tty->ops->throttle)
tty->ops->throttle(tty); tty->ops->throttle(tty);
} }
...@@ -187,7 +187,7 @@ int tty_unthrottle_safe(struct tty_struct *tty) ...@@ -187,7 +187,7 @@ int tty_unthrottle_safe(struct tty_struct *tty)
if (tty->flow_change != TTY_UNTHROTTLE_SAFE) if (tty->flow_change != TTY_UNTHROTTLE_SAFE)
ret = 1; ret = 1;
else { else {
__clear_bit(TTY_THROTTLED, &tty->flags); clear_bit(TTY_THROTTLED, &tty->flags);
if (tty->ops->unthrottle) if (tty->ops->unthrottle)
tty->ops->unthrottle(tty); tty->ops->unthrottle(tty);
} }
......
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