qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] usb-serial: Fail instead of crash when chardev is missing
@ 2010-05-28 15:03 Markus Armbruster
  2010-05-31  9:24 ` [Qemu-devel] " Gerd Hoffmann
  2010-06-30 18:36 ` [Qemu-devel] " Aurelien Jarno
  0 siblings, 2 replies; 3+ messages in thread
From: Markus Armbruster @ 2010-05-28 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann


Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/usb-serial.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/hw/usb-serial.c b/hw/usb-serial.c
index 5b2483a..c19580f 100644
--- a/hw/usb-serial.c
+++ b/hw/usb-serial.c
@@ -545,6 +545,11 @@ static int usb_serial_initfn(USBDevice *dev)
     USBSerialState *s = DO_UPCAST(USBSerialState, dev, dev);
     s->dev.speed = USB_SPEED_FULL;
 
+    if (!s->cs) {
+        error_report("Property chardev is required");
+        return -1;
+    }
+
     qemu_chr_add_handlers(s->cs, usb_serial_can_read, usb_serial_read,
                           usb_serial_event, s);
     usb_serial_handle_reset(dev);
-- 
1.6.6.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-30 18:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-28 15:03 [Qemu-devel] [PATCH] usb-serial: Fail instead of crash when chardev is missing Markus Armbruster
2010-05-31  9:24 ` [Qemu-devel] " Gerd Hoffmann
2010-06-30 18:36 ` [Qemu-devel] " Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).