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>
This commit is contained in:
Jiri Slaby 2021-06-18 08:15:09 +02:00 committed by Greg Kroah-Hartman
parent 464fbf6c4f
commit 202acdaa14

View File

@ -1162,13 +1162,13 @@ static int mxser_tiocmget(struct tty_struct *tty)
if (tty_io_error(tty)) if (tty_io_error(tty))
return -EIO; return -EIO;
control = info->MCR;
spin_lock_irqsave(&info->slock, flags); spin_lock_irqsave(&info->slock, flags);
control = info->MCR;
status = inb(info->ioaddr + UART_MSR); status = inb(info->ioaddr + UART_MSR);
if (status & UART_MSR_ANY_DELTA) if (status & UART_MSR_ANY_DELTA)
mxser_check_modem_status(tty, info, status); mxser_check_modem_status(tty, info, status);
spin_unlock_irqrestore(&info->slock, flags); spin_unlock_irqrestore(&info->slock, flags);
return ((control & UART_MCR_RTS) ? TIOCM_RTS : 0) | return ((control & UART_MCR_RTS) ? TIOCM_RTS : 0) |
((control & UART_MCR_DTR) ? TIOCM_DTR : 0) | ((control & UART_MCR_DTR) ? TIOCM_DTR : 0) |
((status & UART_MSR_DCD) ? TIOCM_CAR : 0) | ((status & UART_MSR_DCD) ? TIOCM_CAR : 0) |