[PATCH v0 40/42] EDAC/altera: Check notifier registration return value
From: Borislav Petkov
Date: Mon Nov 08 2021 - 05:17:07 EST
From: Borislav Petkov <bp@xxxxxxx>
Avoid homegrown notifier registration checks.
No functional changes.
Signed-off-by: Borislav Petkov <bp@xxxxxxx>
Cc: linux-edac@xxxxxxxxxxxxxxx
---
drivers/edac/altera_edac.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 3a6d2416cb0f..49fa7ae77ba3 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -2125,8 +2125,10 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
int dberror, err_addr;
edac->panic_notifier.notifier_call = s10_edac_dberr_handler;
- atomic_notifier_chain_register(&panic_notifier_list,
- &edac->panic_notifier);
+
+ if (atomic_notifier_chain_register(&panic_notifier_list,
+ &edac->panic_notifier))
+ pr_warn("Panic notifier already registered\n");
/* Printout a message if uncorrectable error previously. */
regmap_read(edac->ecc_mgr_map, S10_SYSMGR_UE_VAL_OFST,
--
2.29.2