From: Roel Kluin <12o3l@tiscali.nl>
Date: Mon, 28 Apr 2008 09:11:50 +0000 (-0700)
Subject: dz: test after postfix decrement fails in dz_console_putchar()
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1ecf0d0cd28a4bfed3009f752061998e52d14db2;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git

dz: test after postfix decrement fails in dz_console_putchar()

When loops reaches 0 the postfix decrement still subtracts, so the subsequent
test fails.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Johannes Weiner <hannes@saeurebad.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---

diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c
index 116211fcd36f..0dddd68b20d2 100644
--- a/drivers/serial/dz.c
+++ b/drivers/serial/dz.c
@@ -819,7 +819,7 @@ static void dz_console_putchar(struct uart_port *uport, int ch)
 		dz_out(dport, DZ_TCR, mask);
 		iob();
 		udelay(2);
-	} while (loops--);
+	} while (--loops);
 
 	if (loops)				/* Cannot send otherwise. */
 		dz_out(dport, DZ_TDR, ch);