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