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-18-bp@alien8.de>
Date:   Mon,  8 Nov 2021 11:11:32 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     LKML <linux-kernel@...r.kernel.org>
Cc:     linux-fbdev@...r.kernel.org, linux-hyperv@...r.kernel.org
Subject: [PATCH v0 17/42] drivers: video: 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-fbdev@...r.kernel.org
Cc: linux-hyperv@...r.kernel.org
---
 drivers/video/console/dummycon.c | 3 ++-
 drivers/video/fbdev/hyperv_fb.c  | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c
index f1711b2f9ff0..2d0cdd76dfde 100644
--- a/drivers/video/console/dummycon.c
+++ b/drivers/video/console/dummycon.c
@@ -36,7 +36,8 @@ void dummycon_register_output_notifier(struct notifier_block *nb)
 {
 	WARN_CONSOLE_UNLOCKED();
 
-	raw_notifier_chain_register(&dummycon_output_nh, nb);
+	if (raw_notifier_chain_register(&dummycon_output_nh, nb))
+		pr_warn("dummycon output notifier already registered\n");
 
 	if (dummycon_putc_called)
 		nb->notifier_call(nb, 0, NULL);
diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
index 23999df52739..183bd459e5c2 100644
--- a/drivers/video/fbdev/hyperv_fb.c
+++ b/drivers/video/fbdev/hyperv_fb.c
@@ -1255,8 +1255,9 @@ static int hvfb_probe(struct hv_device *hdev,
 
 	par->synchronous_fb = false;
 	par->hvfb_panic_nb.notifier_call = hvfb_on_panic;
-	atomic_notifier_chain_register(&panic_notifier_list,
-				       &par->hvfb_panic_nb);
+
+	if (atomic_notifier_chain_register(&panic_notifier_list, &par->hvfb_panic_nb))
+		pr_warn("Hyper-V FB panic notifier already registered\n");
 
 	return 0;
 
-- 
2.29.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ