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>] [day] [month] [year] [list]
Message-Id: <20231127145103.29912-1-liuhaoran14@163.com>
Date:   Mon, 27 Nov 2023 06:51:03 -0800
From:   Haoran Liu <liuhaoran14@....com>
To:     richard.henderson@...aro.org
Cc:     ink@...assic.park.msu.ru, mattst88@...il.com,
        linux-alpha@...r.kernel.org, linux-kernel@...r.kernel.org,
        Haoran Liu <liuhaoran14@....com>
Subject: [PATCH] alpha: Improve error handling in alpha_rtc_init

This patch enhances the alpha_rtc_init function in
arch/alpha/kernel/rtc.c by adding error handling for the
platform_device_register_simple call.

Signed-off-by: Haoran Liu <liuhaoran14@....com>
---
 arch/alpha/kernel/rtc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/alpha/kernel/rtc.c b/arch/alpha/kernel/rtc.c
index fb3025396ac9..576397b1fac2 100644
--- a/arch/alpha/kernel/rtc.c
+++ b/arch/alpha/kernel/rtc.c
@@ -209,6 +209,9 @@ alpha_rtc_init(void)
 	init_rtc_epoch();
 
 	pdev = platform_device_register_simple("rtc-alpha", -1, NULL, 0);
+	if (IS_ERR(pdev))
+		return PTR_ERR(pdev);
+
 	rtc = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ