aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-scsi.c
diff options
context:
space:
mode:
authorOrit Wassermann <owasserm@redhat.com>2012-05-16 12:21:35 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2012-05-21 15:40:50 -0500
commit2a633c461e96cb9a856292c46917653bd43959c8 (patch)
tree2907c129ba38047391cea14d072594f866479450 /hw/virtio-scsi.c
parenta6c5c84ae25bc68f22725f77d6d77c98af5c4f9e (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-scsi.c')
-rw-r--r--hw/virtio-scsi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
index e8328f4652..5e39ce93c4 100644
--- a/hw/virtio-scsi.c
+++ b/hw/virtio-scsi.c
@@ -564,7 +564,12 @@ static void virtio_scsi_save(QEMUFile *f, void *opaque)
static int virtio_scsi_load(QEMUFile *f, void *opaque, int version_id)
{
VirtIOSCSI *s = opaque;
- virtio_load(&s->vdev, f);
+ int ret;
+
+ ret = virtio_load(&s->vdev, f);
+ if (ret) {
+ return ret;
+ }
return 0;
}