aboutsummaryrefslogtreecommitdiff
path: root/hw/net
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/net
parent63122df2315564253b14d2abec1d854570488f83 (diff)
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/net')
-rw-r--r--hw/net/virtio-net.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 940a7cfe54..dd28a5a0a4 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1509,14 +1509,10 @@ void virtio_net_set_netclient_name(VirtIONet *n, const char *name,
*/
assert(type != NULL);
- if (n->netclient_name) {
- g_free(n->netclient_name);
- n->netclient_name = NULL;
- }
- if (n->netclient_type) {
- g_free(n->netclient_type);
- n->netclient_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);
@@ -1616,14 +1612,10 @@ static void virtio_net_device_unrealize(DeviceState *dev, Error **errp)
unregister_savevm(dev, "virtio-net", n);
- if (n->netclient_name) {
- g_free(n->netclient_name);
- n->netclient_name = NULL;
- }
- if (n->netclient_type) {
- g_free(n->netclient_type);
- n->netclient_type = NULL;
- }
+ g_free(n->netclient_name);
+ n->netclient_name = NULL;
+ g_free(n->netclient_type);
+ n->netclient_type = NULL;
g_free(n->mac_table.macs);
g_free(n->vlans);