diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/net/virtio-net.c | 7 | ||||
-rw-r--r-- | hw/virtio/virtio.c | 6 |
2 files changed, 2 insertions, 11 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index dd28a5a0a4..0a34a8b908 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1510,13 +1510,8 @@ void virtio_net_set_netclient_name(VirtIONet *n, const char *name, assert(type != NULL); g_free(n->netclient_name); - n->netclient_name = NULL; g_free(n->netclient_type); - n->netclient_type = NULL; - - if (name != NULL) { - n->netclient_name = g_strdup(name); - } + n->netclient_name = g_strdup(name); n->netclient_type = g_strdup(type); } diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 3b938c8783..a3082d569d 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1165,11 +1165,7 @@ EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq) void virtio_device_set_child_bus_name(VirtIODevice *vdev, char *bus_name) { g_free(vdev->bus_name); - vdev->bus_name = NULL; - - if (bus_name) { - vdev->bus_name = g_strdup(bus_name); - } + vdev->bus_name = g_strdup(bus_name); } static void virtio_device_realize(DeviceState *dev, Error **errp) |