diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-04-15 11:06:06 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-15 14:08:12 -0400 |
commit | 579a00a5c2f0a85fb4602a53e2c1beb77a646528 (patch) | |
tree | 7a78af34a407997e0ecc49e0dfbf515587c0ec24 /drivers/tty/tty_ioctl.c | |
parent | 31815c08fc90f44d6165034fd473f23df5d31449 (diff) |
tty: Fix unsafe bit ops in tty_throttle_safe/unthrottle_safe
tty->flags needs to be atomically modified.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_ioctl.c')
-rw-r--r-- | drivers/tty/tty_ioctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c index d119034877de..3500d4114147 100644 --- a/drivers/tty/tty_ioctl.c +++ b/drivers/tty/tty_ioctl.c | |||
@@ -156,7 +156,7 @@ int tty_throttle_safe(struct tty_struct *tty) | |||
156 | if (tty->flow_change != TTY_THROTTLE_SAFE) | 156 | if (tty->flow_change != TTY_THROTTLE_SAFE) |
157 | ret = 1; | 157 | ret = 1; |
158 | else { | 158 | else { |
159 | __set_bit(TTY_THROTTLED, &tty->flags); | 159 | set_bit(TTY_THROTTLED, &tty->flags); |
160 | if (tty->ops->throttle) | 160 | if (tty->ops->throttle) |
161 | tty->ops->throttle(tty); | 161 | tty->ops->throttle(tty); |
162 | } | 162 | } |
@@ -187,7 +187,7 @@ int tty_unthrottle_safe(struct tty_struct *tty) | |||
187 | if (tty->flow_change != TTY_UNTHROTTLE_SAFE) | 187 | if (tty->flow_change != TTY_UNTHROTTLE_SAFE) |
188 | ret = 1; | 188 | ret = 1; |
189 | else { | 189 | else { |
190 | __clear_bit(TTY_THROTTLED, &tty->flags); | 190 | clear_bit(TTY_THROTTLED, &tty->flags); |
191 | if (tty->ops->unthrottle) | 191 | if (tty->ops->unthrottle) |
192 | tty->ops->unthrottle(tty); | 192 | tty->ops->unthrottle(tty); |
193 | } | 193 | } |