int pt_init(PCIBus *e_bus, const char *direct_pci)
{
- int seg, b, d, f, php_slot = 0;
+ int seg, b, d, f, php_slot = 0, status = -1;
struct pt_dev *pt_dev;
struct pci_access *pci_access;
char *vslots;
if ( pt_dev == NULL )
{
PT_LOG("Error: Registration failed (%02x:%02x.%x)\n", b, d, f);
- free(direct_pci_head);
- return -1;
+ goto err;
}
/* Record the virtual slot info */
/* Write virtual slots info to xenstore for Control panel use */
xenstore_write_vslots(vslots);
+ status = 0;
+err:
qemu_free(vslots);
free(direct_pci_head);
- /* Success */
- return 0;
+ return status;
}