Skip to content

Commit

Permalink
APEI: GHES: correctly return NULL for ghes_get_devices()
Browse files Browse the repository at this point in the history
Since 315bada ("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: 9057a3f ("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>
  • Loading branch information
Li Yang authored and Rafael J. Wysocki committed Jun 12, 2023
1 parent d38f6bc commit 9368aa1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/acpi/apei/ghes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1542,6 +1542,8 @@ struct list_head *ghes_get_devices(void)

pr_warn_once("Force-loading ghes_edac on an unsupported platform. You're on your own!\n");
}
} else if (list_empty(&ghes_devs)) {
return NULL;
}

return &ghes_devs;
Expand Down

0 comments on commit 9368aa1

Please sign in to comment.