Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Peter Hurley and committed by
Greg Kroah-Hartman
579a00a5 31815c08

+2 -2
+2 -2
drivers/tty/tty_ioctl.c
··· 156 156 if (tty->flow_change != TTY_THROTTLE_SAFE) 157 157 ret = 1; 158 158 else { 159 - __set_bit(TTY_THROTTLED, &tty->flags); 159 + set_bit(TTY_THROTTLED, &tty->flags); 160 160 if (tty->ops->throttle) 161 161 tty->ops->throttle(tty); 162 162 } ··· 187 187 if (tty->flow_change != TTY_UNTHROTTLE_SAFE) 188 188 ret = 1; 189 189 else { 190 - __clear_bit(TTY_THROTTLED, &tty->flags); 190 + clear_bit(TTY_THROTTLED, &tty->flags); 191 191 if (tty->ops->unthrottle) 192 192 tty->ops->unthrottle(tty); 193 193 }