if ( !madt )
{
printk("Unable to allocate memory for MADT table\n");
- return -ENOMEM;
+ rc = -ENOMEM;
+ goto out;
}
/* Copy the native MADT table header. */
if ( !ACPI_SUCCESS(status) )
{
printk("Failed to get MADT ACPI table, aborting.\n");
- return -EINVAL;
+ rc = -EINVAL;
+ goto out;
}
madt->header = *table;
madt->address = APIC_DEFAULT_PHYS_BASE;
if ( pvh_steal_ram(d, size, 0, GB(4), addr) )
{
printk("Unable to find allocate guest RAM for MADT\n");
- return -ENOMEM;
+ rc = -ENOMEM;
+ goto out;
}
/* Mark this region as E820_ACPI. */
if ( rc )
{
printk("Unable to copy MADT into guest memory\n");
- return rc;
+ goto out;
}
+
+ rc = 0;
+
+ out:
xfree(madt);
- return 0;
+ return rc;
}
static bool __init acpi_memory_banned(unsigned long address,