Message ID | 1439462687-26903-28-git-send-email-peter.maydell@linaro.org |
---|---|
State | Accepted |
Commit | f7a6785e12d834d05200b0595070db453344b25d |
Headers | show |
diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c index f9da59f..801156d 100644 --- a/hw/char/imx_serial.c +++ b/hw/char/imx_serial.c @@ -125,7 +125,9 @@ static uint64_t imx_serial_read(void *opaque, hwaddr offset, s->usr2 &= ~USR2_RDR; s->uts1 |= UTS1_RXEMPTY; imx_update(s); - qemu_chr_accept_input(s->chr); + if (s->chr) { + qemu_chr_accept_input(s->chr); + } } return c; @@ -212,7 +214,9 @@ static void imx_serial_write(void *opaque, hwaddr offset, } if (value & UCR2_RXEN) { if (!(s->ucr2 & UCR2_RXEN)) { - qemu_chr_accept_input(s->chr); + if (s->chr) { + qemu_chr_accept_input(s->chr); + } } } s->ucr2 = value & 0xffff;