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-36-bp@alien8.de>
Date:   Mon,  8 Nov 2021 11:11:50 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     LKML <linux-kernel@...r.kernel.org>
Cc:     linux-sh@...r.kernel.org
Subject: [PATCH v0 35/42] sh: 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-sh@...r.kernel.org
---
 arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index 0d990ab1ba2a..8dfbb8149f66 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -1277,11 +1277,14 @@ static struct notifier_block sh7724_post_sleep_notifier = {
 
 static int __init sh7724_sleep_setup(void)
 {
-	atomic_notifier_chain_register(&sh_mobile_pre_sleep_notifier_list,
-				       &sh7724_pre_sleep_notifier);
+	if (atomic_notifier_chain_register(&sh_mobile_pre_sleep_notifier_list,
+					   &sh7724_pre_sleep_notifier))
+		pr_warn("SH7724 pre-sleep notifier already registered\n");
+
+	if (atomic_notifier_chain_register(&sh_mobile_post_sleep_notifier_list,
+					   &sh7724_post_sleep_notifier))
+		pr_warn("SH7724 pre-sleep notifier already registered\n");
 
-	atomic_notifier_chain_register(&sh_mobile_post_sleep_notifier_list,
-				       &sh7724_post_sleep_notifier);
 	return 0;
 }
 arch_initcall(sh7724_sleep_setup);
-- 
2.29.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ