aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-net.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-net.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-net.c')
-rw-r--r--hw/virtio-net.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index bc5e3a83d1..3f190d417e 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -891,11 +891,15 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
{
VirtIONet *n = opaque;
int i;
+ int ret;
if (version_id < 2 || version_id > VIRTIO_NET_VM_VERSION)
return -EINVAL;
- virtio_load(&n->vdev, f);
+ ret = virtio_load(&n->vdev, f);
+ if (ret) {
+ return ret;
+ }
qemu_get_buffer(f, n->mac, ETH_ALEN);
n->tx_waiting = qemu_get_be32(f);