From: Rafael J. Wysocki Date: Fri, 22 Feb 2013 23:14:57 +0000 (+0100) Subject: ACPI / APEI: Fix crash in apei_hest_parse() for acpi=off X-Git-Tag: upstream/snapshot3+hdmi~5650^2~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a84363d6fdba14663b6b155eec604b6c0f6f8866;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ACPI / APEI: Fix crash in apei_hest_parse() for acpi=off After commit 92ef2a2 (ACPI: Change the ordering of PCI root bridge driver registrarion), acpi_hest_init() is never called for acpi=off (acpi_disabled), so hest_disable is not set, but hest_tab is NULL, which causes apei_hest_parse() to crash when it is called from aer_acpi_firmware_first(). Fix that by making apei_hest_parse() check if hest_tab is not NULL in addition to checking hest_disable. Also remove the now useless acpi_disabled check from apei_hest_parse(). Reported-by: Thomas Gleixner Tested-by: Thomas Gleixner Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c index 7f00cf3..f5ef5d5 100644 --- a/drivers/acpi/apei/hest.c +++ b/drivers/acpi/apei/hest.c @@ -89,7 +89,7 @@ int apei_hest_parse(apei_hest_func_t func, void *data) struct acpi_hest_header *hest_hdr; int i, rc, len; - if (hest_disable) + if (hest_disable || !hest_tab) return -EINVAL; hest_hdr = (struct acpi_hest_header *)(hest_tab + 1); @@ -216,9 +216,6 @@ void __init acpi_hest_init(void) return; } - if (acpi_disabled) - goto err; - status = acpi_get_table(ACPI_SIG_HEST, 0, (struct acpi_table_header **)&hest_tab); if (status == AE_NOT_FOUND)