Skip to contentSkip to conversation

EDAC, ghes: Do not register instance if platform is not whitelisted

PATCH Borislav Petkov 1 participant 1 message Apr 23, 2018

Subsystems (2)
lore
Share & tools
lore

Borislav Petkov

author maintainer
#0 lore raw

Lemme write an official patch:
---
Tony reported seeing

"Internal error: Can't find EDAC structure"

when injecting correctable errors.

The problem is that we should exit registration when platform doesn't match the whitelisted ones.

Do that.

---
 drivers/edac/ghes_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/edac/ghes_edac.c +1 -1
index 68b6ee18bea6..4a9231993699 100644
@@ -439,7 +439,7 @@ int ghes_edac_register(struct ghes *ghes, struct device *dev)
 	/* Check if safe to enable on this system */
 	idx = acpi_match_platform_list(plat_list);
 	if (!force_load && idx < 0)
-		return 0;
+		return -ENODEV;
 
 	/*
 	 * We have only one logical memory controller to which all DIMMs belong.