|
|
b28c64 |
From a04a0d4cf131163600ebede71d223d9d01a32511 Mon Sep 17 00:00:00 2001
|
|
|
b28c64 |
From: Fam Zheng <famz@redhat.com>
|
|
|
b28c64 |
Date: Fri, 19 May 2017 00:35:09 +0200
|
|
|
b28c64 |
Subject: [PATCH 04/18] char/serial: fix copy&paste error (fifo8_is_full vs
|
|
|
b28c64 |
empty)
|
|
|
b28c64 |
|
|
|
b28c64 |
RH-Author: Fam Zheng <famz@redhat.com>
|
|
|
b28c64 |
Message-id: <20170519003523.21163-5-famz@redhat.com>
|
|
|
b28c64 |
Patchwork-id: 75360
|
|
|
b28c64 |
O-Subject: [RHEL-7.3.z qemu-kvm PATCH 04/18] char/serial: fix copy&paste error (fifo8_is_full vs empty)
|
|
|
b28c64 |
Bugzilla: 1452332
|
|
|
b28c64 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
b28c64 |
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
b28c64 |
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
b28c64 |
|
|
|
b28c64 |
From: Vladimir Senkov <hangup@gmail.com>
|
|
|
b28c64 |
|
|
|
b28c64 |
Copy&paste error in serial.c causes a crash when attempting
|
|
|
b28c64 |
to read from UART (if there is no data to be read)
|
|
|
b28c64 |
|
|
|
b28c64 |
Signed-off-by: Vladimir Senkov <hangup@gmail.com>
|
|
|
b28c64 |
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
|
|
|
b28c64 |
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
|
|
|
b28c64 |
(cherry picked from commit b165b0d8e62bb65a02d7670d75ebb77a9280bde1)
|
|
|
b28c64 |
Signed-off-by: Fam Zheng <famz@redhat.com>
|
|
|
b28c64 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
b28c64 |
---
|
|
|
b28c64 |
hw/char/serial.c | 2 +-
|
|
|
b28c64 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
b28c64 |
|
|
|
b28c64 |
diff --git a/hw/char/serial.c b/hw/char/serial.c
|
|
|
b28c64 |
index 72112cc..3345de1 100644
|
|
|
b28c64 |
--- a/hw/char/serial.c
|
|
|
b28c64 |
+++ b/hw/char/serial.c
|
|
|
b28c64 |
@@ -425,7 +425,7 @@ static uint64_t serial_ioport_read(void *opaque, hwaddr addr, unsigned size)
|
|
|
b28c64 |
ret = s->divider & 0xff;
|
|
|
b28c64 |
} else {
|
|
|
b28c64 |
if(s->fcr & UART_FCR_FE) {
|
|
|
b28c64 |
- ret = fifo8_is_full(&s->recv_fifo) ?
|
|
|
b28c64 |
+ ret = fifo8_is_empty(&s->recv_fifo) ?
|
|
|
b28c64 |
0 : fifo8_pop(&s->recv_fifo);
|
|
|
b28c64 |
if (s->recv_fifo.num == 0) {
|
|
|
b28c64 |
s->lsr &= ~(UART_LSR_DR | UART_LSR_BI);
|
|
|
b28c64 |
--
|
|
|
b28c64 |
1.8.3.1
|
|
|
b28c64 |
|