diff options
author | Orit Wassermann <owasserm@redhat.com> | 2012-05-16 12:21:35 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-05-21 15:40:50 -0500 |
commit | 2a633c461e96cb9a856292c46917653bd43959c8 (patch) | |
tree | 2907c129ba38047391cea14d072594f866479450 /hw/virtio-serial-bus.c | |
parent | a6c5c84ae25bc68f22725f77d6d77c98af5c4f9e (diff) |
virtio: check virtio_load return code
Otherwise we crash on error.
Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com>
Signed-off-by: Orit Wassermann <owasserm@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-serial-bus.c')
-rw-r--r-- | hw/virtio-serial-bus.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index ffbdfc2de1..72287d10ce 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -637,13 +637,17 @@ static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id) VirtIOSerialPort *port; uint32_t max_nr_ports, nr_active_ports, ports_map; unsigned int i; + int ret; if (version_id > 3) { return -EINVAL; } /* The virtio device */ - virtio_load(&s->vdev, f); + ret = virtio_load(&s->vdev, f); + if (ret) { + return ret; + } if (version_id < 2) { return 0; |