summary refs log tree commit diff stats
path: root/hw/virtio/vhost.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-06-06 18:43:29 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-06-19 16:41:53 +0300
commit9e28840658824f52f03f5a69661fd4b22987feeb (patch)
tree4cefb8b99804075ef465404803db6a0b5d38e3f4 /hw/virtio/vhost.c
parent63122df2315564253b14d2abec1d854570488f83 (diff)
downloadfocaccia-qemu-9e28840658824f52f03f5a69661fd4b22987feeb.tar.gz
focaccia-qemu-9e28840658824f52f03f5a69661fd4b22987feeb.zip
virtio: Drop superfluous conditionals around g_free()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'hw/virtio/vhost.c')
-rw-r--r--hw/virtio/vhost.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index f62cfaf38e..9e6023af36 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -295,9 +295,7 @@ static inline void vhost_dev_log_resize(struct vhost_dev* dev, uint64_t size)
     if (dev->log_size) {
         vhost_log_sync_range(dev, 0, dev->log_size * VHOST_LOG_CHUNK - 1);
     }
-    if (dev->log) {
-        g_free(dev->log);
-    }
+    g_free(dev->log);
     dev->log = log;
     dev->log_size = size;
 }
@@ -601,9 +599,7 @@ static int vhost_migration_log(MemoryListener *listener, int enable)
         if (r < 0) {
             return r;
         }
-        if (dev->log) {
-            g_free(dev->log);
-        }
+        g_free(dev->log);
         dev->log = NULL;
         dev->log_size = 0;
     } else {