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

* [Qemu-devel] Re: [PATCH] usb-serial: Fail instead of crash when chardev is missing
  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 ` Gerd Hoffmann
  2010-06-30 18:36 ` [Qemu-devel] " Aurelien Jarno
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2010-05-31  9:24 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel

On 05/28/10 17:03, Markus Armbruster wrote:
>
> Signed-off-by: Markus Armbruster<armbru@redhat.com>

Nice catch.

Acked-by: Gerd Hoffmann <kraxel@redhat.com>

cheers,
   Gerd

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

* Re: [Qemu-devel] [PATCH] usb-serial: Fail instead of crash when chardev is missing
  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 ` Aurelien Jarno
  1 sibling, 0 replies; 3+ messages in thread
From: Aurelien Jarno @ 2010-06-30 18:36 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, Gerd Hoffmann

On Fri, May 28, 2010 at 05:03:22PM +0200, Markus Armbruster wrote:
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  hw/usb-serial.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)

Thanks, applied.

> 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
> 
> 
> 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[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).