lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211108101157.15189-32-bp@alien8.de>
Date:   Mon,  8 Nov 2021 11:11:46 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     LKML <linux-kernel@...r.kernel.org>
Cc:     linux-parisc@...r.kernel.org
Subject: [PATCH v0 31/42] parisc: Check notifier registration return value

From: Borislav Petkov <bp@...e.de>

Avoid homegrown notifier registration checks.

No functional changes.

Signed-off-by: Borislav Petkov <bp@...e.de>
Cc: linux-parisc@...r.kernel.org
---
 arch/parisc/kernel/pdc_chassis.c | 5 +++--
 drivers/parisc/power.c           | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/parisc/kernel/pdc_chassis.c b/arch/parisc/kernel/pdc_chassis.c
index da154406d368..8bedc9faa791 100644
--- a/arch/parisc/kernel/pdc_chassis.c
+++ b/arch/parisc/kernel/pdc_chassis.c
@@ -135,8 +135,9 @@ void __init parisc_pdc_chassis_init(void)
 				PDC_CHASSIS_VER);
 
 		/* initialize panic notifier chain */
-		atomic_notifier_chain_register(&panic_notifier_list,
-				&pdc_chassis_panic_block);
+		if (atomic_notifier_chain_register(&panic_notifier_list,
+						   &pdc_chassis_panic_block))
+			printk(KERN_WARNING "Panic notifier already registered\n");
 
 		/* initialize reboot notifier chain */
 		register_reboot_notifier(&pdc_chassis_reboot_block);
diff --git a/drivers/parisc/power.c b/drivers/parisc/power.c
index 456776bd8ee6..26dabaa1e5f8 100644
--- a/drivers/parisc/power.c
+++ b/drivers/parisc/power.c
@@ -230,8 +230,9 @@ static int __init power_init(void)
 	}
 
 	/* Register a call for panic conditions. */
-	atomic_notifier_chain_register(&panic_notifier_list,
-			&parisc_panic_block);
+
+	if (atomic_notifier_chain_register(&panic_notifier_list, &parisc_panic_block))
+		pr_warn("Panic notifier already registered\n");
 
 	return 0;
 }
-- 
2.29.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ