Skip to contentSkip to conversation

virtio: Remove malloc failure checks

PATCH Applied Jan Kiszka 2 participants 2 messages Feb 9, 2009 – Feb 16, 2009

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 virtio: Remove malloc failure checks

No need to check for failing qemu_malloc anymore.

---

 hw/virtio-net.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
hw/virtio-net.c +0 -4
index 62153e9..b56c10f 100644
@@ -598,12 +598,8 @@ void 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);
#1 lore raw
Quoted 5 lines · Jan Kiszka

No need to check for failing qemu_malloc anymore.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 26 lines

---

 hw/virtio-net.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
hw/virtio-net.c +0 -4
index 62153e9..b56c10f 100644
@@ -598,12 +598,8 @@ void 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);