aboutsummaryrefslogtreecommitdiff
path: root/hw/net
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-06-06 18:43:30 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-06-19 16:41:53 +0300
commit80e0090a44388d8924f548e49f7390c1e1585761 (patch)
tree15bba61eb0e8a124dd105ac210807eb462080e42 /hw/net
parent9e28840658824f52f03f5a69661fd4b22987feeb (diff)
virtio: Drop superfluous conditionals around g_strdup()
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/net')
-rw-r--r--hw/net/virtio-net.c7
1 files changed, 1 insertions, 6 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);
}