Unverified Commit 789262d4 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12032 serial: sc16is7xx: fix invalid FIFO access with special register set

parents aa9a9c28 4f3ce001
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -538,6 +538,8 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)
			      SC16IS7XX_MCR_CLKSEL_BIT,
			      prescaler);

	mutex_lock(&s->efr_lock);

	/* Open the LCR divisors for configuration */
	sc16is7xx_port_write(port, SC16IS7XX_LCR_REG,
			     SC16IS7XX_LCR_CONF_MODE_A);
@@ -551,6 +553,8 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)
	/* Put LCR back to the normal mode */
	sc16is7xx_port_write(port, SC16IS7XX_LCR_REG, lcr);

	mutex_unlock(&s->efr_lock);

	return DIV_ROUND_CLOSEST(clk / 16, div);
}