Skip to content

Commit 720e78d

Browse files
Dan Carpentergregkh
authored andcommitted
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: 86ee55e ("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>
1 parent 54be6c6 commit 720e78d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/serial/8250/8250_pci1xxxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static void pci1xxxx_process_read_data(struct uart_port *port,
302302
* to read, the data is received one byte at a time.
303303
*/
304304
while (valid_burst_count--) {
305-
if (*buff_index >= (RX_BUF_SIZE - UART_BURST_SIZE))
305+
if (*buff_index > (RX_BUF_SIZE - UART_BURST_SIZE))
306306
break;
307307
burst_buf = (u32 *)&rx_buff[*buff_index];
308308
*burst_buf = readl(port->membase + UART_RX_BURST_FIFO);

0 commit comments

Comments
 (0)