hw/pl011.c: Avoid crash on read when no chr backend present
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 20 Jul 2012 12:34:49 +0000 (13:34 +0100)
committerPeter Maydell <petmay01@cam-vm-266.(none)>
Fri, 20 Jul 2012 12:34:49 +0000 (13:34 +0100)
commit0d4abda8f7328c8911c1d020bb6961650eaf7801
treef975cc0627bb1d190fd195c5fa3f1de42e81d36a
parent61dc008f3529fa74a63aad1907438dad857e255a
hw/pl011.c: Avoid crash on read when no chr backend present

Add a missing guard that meant we would segfault if the guest read
UARTDR on a PL011 serial device which had no chr backend connected.
(This didn't happen for Linux guests because Linux reads the flags
register and doesn't try to read the UART if it's empty.)

Reported-by: Christian Müller <christian.mueller@heig-vd.ch>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/pl011.c