virtio bus: Fix resource leak. CID 1032283

* bus is allocated but not deleted and not used
  after an error
This commit is contained in:
Alexander von Gluck IV
2013-06-24 15:18:23 -05:00
parent b027a0a2f7
commit 27938cb64f
@@ -252,7 +252,6 @@ init_bus(device_node* node, void** bus_cookie)
pci_device_module_info* pci;
pci_device* device;
{
device_node* parent = gDeviceManager->get_parent_node(node);
device_node* pciParent = gDeviceManager->get_parent_node(parent);
@@ -276,6 +275,7 @@ init_bus(device_node* node, void** bus_cookie)
bus->irq = pciInfo.u.h0.interrupt_line;
if (bus->irq == 0 || bus->irq == 0xff) {
ERROR("PCI IRQ not assigned\n");
delete bus;
return B_ERROR;
}