Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

APEI: GHES: correctly return NULL for ghes_get_devices()

Since 315bada690e0 ("EDAC: Check for GHES preference in the
chipset-specific EDAC drivers"), vendor specific EDAC driver will not
probe correctly when CONFIG_ACPI_APEI_GHES is enabled but no GHES device
is present. Make ghes_get_devices() return NULL when the GHES device
list is empty to fix the problem.

Fixes: 9057a3f7ac36 ("EDAC/ghes: Prepare to make ghes_edac a proper module")
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Li Yang and committed by
Rafael J. Wysocki
9368aa18 d38f6bce

+2
+2
drivers/acpi/apei/ghes.c
··· 1542 1542 1543 1543 pr_warn_once("Force-loading ghes_edac on an unsupported platform. You're on your own!\n"); 1544 1544 } 1545 + } else if (list_empty(&ghes_devs)) { 1546 + return NULL; 1545 1547 } 1546 1548 1547 1549 return &ghes_devs;