mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
char/cadence_uart: Fix reset for unattached instances
commit 1db8b5efe0
introduced an issue
where QEMU would segfault if you have an unattached Cadence UART.
Fix by guarding the flush-on-reset logic on there being a qemu_chr
attachment.
Reported-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Tested-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Message-id: 9009578ee10a50d994b2e10aa2840d73765f5968.1370577272.git.peter.crosthwaite@xilinx.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
c3cb8e7780
commit
9121d02cb3
1 changed files with 3 additions and 1 deletions
|
@ -157,7 +157,9 @@ static void uart_rx_reset(UartState *s)
|
|||
{
|
||||
s->rx_wpos = 0;
|
||||
s->rx_count = 0;
|
||||
qemu_chr_accept_input(s->chr);
|
||||
if (s->chr) {
|
||||
qemu_chr_accept_input(s->chr);
|
||||
}
|
||||
|
||||
s->r[R_SR] |= UART_SR_INTR_REMPTY;
|
||||
s->r[R_SR] &= ~UART_SR_INTR_RFUL;
|
||||
|
|
Loading…
Reference in a new issue