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-next>] [day] [month] [year] [list]
Date:   Tue, 28 Nov 2023 22:37:30 -0800
From:   Haoran Liu <liuhaoran14@....com>
To:     ysato@...rs.sourceforge.jp
Cc:     dalias@...c.org, glaubitz@...sik.fu-berlin.de,
        linux-sh@...r.kernel.org, linux-kernel@...r.kernel.org,
        Haoran Liu <liuhaoran14@....com>
Subject: [PATCH] [sh/highlander] psw: Add error handling in psw_irq_handler

This patch adds error handling for the platform_get_drvdata call
within the psw_irq_handler function in
arch/sh/boards/mach-highlander/psw.c. Previously, the absence of
error checking could lead to unexpected behavior if
platform_get_drvdata returned a null pointer.

Signed-off-by: Haoran Liu <liuhaoran14@....com>
---
 arch/sh/boards/mach-highlander/psw.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/sh/boards/mach-highlander/psw.c b/arch/sh/boards/mach-highlander/psw.c
index d445c54f74e4..e079215e50e3 100644
--- a/arch/sh/boards/mach-highlander/psw.c
+++ b/arch/sh/boards/mach-highlander/psw.c
@@ -21,6 +21,12 @@ static irqreturn_t psw_irq_handler(int irq, void *arg)
 	unsigned int l, mask;
 	int ret = 0;
 
+	if (!psw) {
+		pr_err("psw_irq_handler: No push_switch data associated
+			with platform_device\n");
+		return IRQ_NONE;
+	}
+
 	l = __raw_readw(PA_DBSW);
 
 	/* Nothing to do if there's no state change */
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ