[Xen-devel,2/2] ACPI/table: Make acpi_table_init return meaningful value

Message ID 1438661972-10140-3-git-send-email-zhaoshenglong@huawei.com
State New
Headers show

Commit Message

Shannon Zhao Aug. 4, 2015, 4:19 a.m.
From: Shannon Zhao <shannon.zhao@linaro.org>

If ACPI fails to initialize tables, it should return one meaningful
value to tell the caller to diable acpi.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 xen/drivers/acpi/tables.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index 822689e..1594e3b 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -330,7 +330,11 @@  static void __init check_multiple_madt(void)
 
 int __init acpi_table_init(void)
 {
-	acpi_initialize_tables(NULL, ACPI_MAX_TABLES, 0);
+	acpi_status status;
+
+	status = acpi_initialize_tables(NULL, ACPI_MAX_TABLES, 0);
+	if (ACPI_FAILURE(status))
+		return -EINVAL;
 	check_multiple_madt();
 	return 0;
 }