Skip to content

Commit

Permalink
tty: Fix unsafe bit ops in tty_throttle_safe/unthrottle_safe
Browse files Browse the repository at this point in the history
tty->flags needs to be atomically modified.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peter Hurley authored and Greg Kroah-Hartman committed Apr 15, 2013
1 parent 31815c0 commit 579a00a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/tty/tty_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ int tty_throttle_safe(struct tty_struct *tty)
if (tty->flow_change != TTY_THROTTLE_SAFE)
ret = 1;
else {
__set_bit(TTY_THROTTLED, &tty->flags);
set_bit(TTY_THROTTLED, &tty->flags);
if (tty->ops->throttle)
tty->ops->throttle(tty);
}
Expand Down Expand Up @@ -187,7 +187,7 @@ int tty_unthrottle_safe(struct tty_struct *tty)
if (tty->flow_change != TTY_UNTHROTTLE_SAFE)
ret = 1;
else {
__clear_bit(TTY_THROTTLED, &tty->flags);
clear_bit(TTY_THROTTLED, &tty->flags);
if (tty->ops->unthrottle)
tty->ops->unthrottle(tty);
}
Expand Down

0 comments on commit 579a00a

Please sign in to comment.