0d3567f
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
0d3567f
Date: Mon, 10 Feb 2014 22:49:35 -0800
0d3567f
Subject: [PATCH] char/serial: Fix emptyness check
0d3567f
0d3567f
This was guarding against a full fifo rather than an empty fifo when
0d3567f
popping. Fix.
0d3567f
0d3567f
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
0d3567f
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
0d3567f
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
0d3567f
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
0d3567f
(cherry picked from commit 88c1ee73d3231c74ff90bcfc084a7589670ec244)
0d3567f
---
0d3567f
 hw/char/serial.c | 2 +-
0d3567f
 1 file changed, 1 insertion(+), 1 deletion(-)
0d3567f
0d3567f
diff --git a/hw/char/serial.c b/hw/char/serial.c
0d3567f
index 6025592..2989ca2 100644
0d3567f
--- a/hw/char/serial.c
0d3567f
+++ b/hw/char/serial.c
0d3567f
@@ -224,7 +224,7 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque)
0d3567f
 
0d3567f
     if (s->tsr_retry <= 0) {
0d3567f
         if (s->fcr & UART_FCR_FE) {
0d3567f
-            s->tsr = fifo8_is_full(&s->xmit_fifo) ?
0d3567f
+            s->tsr = fifo8_is_empty(&s->xmit_fifo) ?
0d3567f
                         0 : fifo8_pop(&s->xmit_fifo);
0d3567f
             if (!s->xmit_fifo.num) {
0d3567f
                 s->lsr |= UART_LSR_THRE;