if ( !xsdt )
{
printk("Unable to allocate memory for XSDT table\n");
- return -ENOMEM;
+ rc = -ENOMEM;
+ goto out;
}
/* Copy the native XSDT table header. */
if ( !rsdp )
{
printk("Unable to map RSDP\n");
- return -EINVAL;
+ rc = -EINVAL;
+ goto out;
}
xsdt_paddr = rsdp->xsdt_physical_address;
acpi_os_unmap_memory(rsdp, sizeof(*rsdp));
if ( !table )
{
printk("Unable to map XSDT\n");
- return -EINVAL;
+ rc = -EINVAL;
+ goto out;
}
xsdt->header = *table;
acpi_os_unmap_memory(table, sizeof(*table));
if ( pvh_steal_ram(d, size, 0, GB(4), addr) )
{
printk("Unable to find guest RAM for XSDT\n");
- return -ENOMEM;
+ rc = -ENOMEM;
+ goto out;
}
/* Mark this region as E820_ACPI. */
if ( rc )
{
printk("Unable to copy XSDT into guest memory\n");
- return rc;
+ goto out;
}
+
+ rc = 0;
+
+ out:
xfree(xsdt);
- return 0;
+ return rc;
}
static int __init pvh_setup_acpi(struct domain *d, paddr_t start_info)