From 2a633c461e96cb9a856292c46917653bd43959c8 Mon Sep 17 00:00:00 2001 From: Orit Wassermann Date: Wed, 16 May 2012 12:21:35 +0200 Subject: virtio: check virtio_load return code Otherwise we crash on error. Signed-off-by: Ulrich Obergfell Signed-off-by: Orit Wassermann Signed-off-by: Paolo Bonzini Signed-off-by: Anthony Liguori --- hw/virtio-scsi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'hw/virtio-scsi.c') diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c index e8328f4..5e39ce9 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; } -- cgit v1.1