* [PATCH] alpha: Improve error handling in alpha_rtc_init
@ 2023-11-27 14:51 Haoran Liu
0 siblings, 0 replies; only message in thread
From: Haoran Liu @ 2023-11-27 14:51 UTC (permalink / raw)
To: richard.henderson; +Cc: ink, mattst88, linux-alpha, linux-kernel, Haoran Liu
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@163.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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-27 14:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-27 14:51 [PATCH] alpha: Improve error handling in alpha_rtc_init Haoran Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).