diff options
author | Jiri Slaby <jslaby@suse.cz> | 2021-06-18 08:15:09 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-06-18 13:10:03 +0200 |
commit | 202acdaa143a75d54dd9eec905c7faca7071c1a8 (patch) | |
tree | 85c42b9aa4bb0bef71aa6011f119a6bfc6778fc3 /drivers/tty | |
parent | 464fbf6c4fc22f13df641bacd85840cfb826ba40 (diff) |
mxser: access info->MCR under info->slock
info->MCR is protected by info->slock all over the code. Extend the lock
in mxser_tiocmget around the info->MCR fetch too.
It likely doesn't change anything, but it's always good to be consistent.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210618061516.662-64-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/mxser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 54b9a9c7c9e9..5dd121450813 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -1162,13 +1162,13 @@ static int mxser_tiocmget(struct tty_struct *tty) if (tty_io_error(tty)) return -EIO; - control = info->MCR; - spin_lock_irqsave(&info->slock, flags); + control = info->MCR; status = inb(info->ioaddr + UART_MSR); if (status & UART_MSR_ANY_DELTA) mxser_check_modem_status(tty, info, status); spin_unlock_irqrestore(&info->slock, flags); + return ((control & UART_MCR_RTS) ? TIOCM_RTS : 0) | ((control & UART_MCR_DTR) ? TIOCM_DTR : 0) | ((status & UART_MSR_DCD) ? TIOCM_CAR : 0) | |