Skip to contentSkip to conversation

Fix warnings in virtio-net

PATCH In review Jan Kiszka 2 participants 3 messages Feb 9, 2009 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 Fix warnings in virtio-net

Those void returns are bogus, but there is no need to check for allocation failures anyway.

qemu/hw/virtio-net.c +0 -4
index f125edc..35f66d7 100644
@@ -692,12 +692,8 @@ PCIDevice *virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)
     n->promisc = 1; /* for compatibility */
 
     n->mac_table.macs = qemu_mallocz(MAC_TABLE_ENTRIES * ETH_ALEN);
-    if (!n->mac_table.macs)
-        return;
 
     n->vlans = qemu_mallocz(MAX_VLAN >> 3);
-    if (!n->vlans)
-        return;
 
     register_savevm("virtio-net", virtio_net_id++, VIRTIO_NET_VM_VERSION,
                     virtio_net_save, virtio_net_load, n);
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Jan Kiszka

Those void returns are bogus, but there is no need to check for allocation failures anyway.

Looks good:

but should be re-done as a patch against qemu and sent to qemu-devel.

Thanks,
Mark.

author
#2 lore raw
Quoted 9 lines · Mark McLoughlin
Quoted 2 lines · Jan Kiszka

Those void returns are bogus, but there is no need to check for allocation failures anyway.

Looks good:

but should be re-done as a patch against qemu and sent to qemu-devel.

Indeed. I checked against the wrong branch and thought it was kvm-specific. Will repost.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux