mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
serial: 8250_pci1xxxx: partially revert off by one patch
I was reviewing this code again and I realized I made a mistake here.
It should have been > instead of >=. The subtract ensures that we
don't go out of bounds. My patch meant that we don't read the last
chunk of the buffer.
Fixes: 86ee55e9bc
("serial: 8250_pci1xxxx: fix off by one in pci1xxxx_process_read_data()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/bd6fb361-bbb9-427d-90e8-a5df4de76221@moroto.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
54be6c6c5a
commit
720e78d7fa
1 changed files with 1 additions and 1 deletions
|
@ -302,7 +302,7 @@ static void pci1xxxx_process_read_data(struct uart_port *port,
|
|||
* to read, the data is received one byte at a time.
|
||||
*/
|
||||
while (valid_burst_count--) {
|
||||
if (*buff_index >= (RX_BUF_SIZE - UART_BURST_SIZE))
|
||||
if (*buff_index > (RX_BUF_SIZE - UART_BURST_SIZE))
|
||||
break;
|
||||
burst_buf = (u32 *)&rx_buff[*buff_index];
|
||||
*burst_buf = readl(port->membase + UART_RX_BURST_FIFO);
|
||||
|
|
Loading…
Reference in a new issue