serial: 8250_omap: fix a timeout loop condition
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 29 Apr 2021 07:19:22 +0000 (10:19 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:33 +0000 (16:56 +0200)
[ Upstream commit d7e325aaa8c3593b5a572b583ecad79e95f32e7f ]

This loop ends on -1 so the error message will never be printed.

Fixes: 4bcf59a5dea0 ("serial: 8250: 8250_omap: Account for data in flight during DMA teardown")
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YIpd+kOpXKMpEXPf@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/8250/8250_omap.c

index 0cc6d35..f284c6f 100644 (file)
@@ -784,7 +784,7 @@ static void __dma_rx_do_complete(struct uart_8250_port *p)
                               poll_count--)
                                cpu_relax();
 
-                       if (!poll_count)
+                       if (poll_count == -1)
                                dev_err(p->port.dev, "teardown incomplete\n");
                }
        }