diff options
author | Markus Armbruster <armbru@redhat.com> | 2014-06-06 18:43:29 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-06-19 16:41:53 +0300 |
commit | 9e28840658824f52f03f5a69661fd4b22987feeb (patch) | |
tree | 4cefb8b99804075ef465404803db6a0b5d38e3f4 /hw/virtio/virtio.c | |
parent | 63122df2315564253b14d2abec1d854570488f83 (diff) | |
download | 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/virtio.c')
-rw-r--r-- | hw/virtio/virtio.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index a07ae8ad91..3b938c8783 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1164,10 +1164,8 @@ EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq) void virtio_device_set_child_bus_name(VirtIODevice *vdev, char *bus_name) { - if (vdev->bus_name) { - g_free(vdev->bus_name); - vdev->bus_name = NULL; - } + g_free(vdev->bus_name); + vdev->bus_name = NULL; if (bus_name) { vdev->bus_name = g_strdup(bus_name); @@ -1206,10 +1204,8 @@ static void virtio_device_unrealize(DeviceState *dev, Error **errp) } } - if (vdev->bus_name) { - g_free(vdev->bus_name); - vdev->bus_name = NULL; - } + g_free(vdev->bus_name); + vdev->bus_name = NULL; } static void virtio_device_class_init(ObjectClass *klass, void *data) |