From: sashiko-bot@kernel.org
To: "Liu Dalin" <liudalin@kylinsec.com.cn>
Cc: "Alexandre Belloni" <alexandre.belloni@bootlin.com>,
linux-rtc@vger.kernel.org
Subject: Re: [PATCH v2 1/3] rtc: ftrtc010: fix clock resource leak on probe failure
Date: Thu, 27 Aug 2026 08:15:28 +0000 [thread overview]
Message-ID: <20260827081528.9D2481F000E9@smtp.kernel.org> (raw)
In-Reply-To: <AC51B5F2C5FFEBB0+20260827080320.3351155-2-liudalin@kylinsec.com.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Shared interrupt handler unconditionally returns IRQ_HANDLED, defeating the kernel's spurious interrupt detection.
--
commit 8daf0ea14af5dc0abeba82e55b73ddd78a69f258
Author: Liu Dalin <liudalin@kylinsec.com.cn>
rtc: ftrtc010: fix clock resource leak on probe failure
This commit fixes a clock resource leak during the RTC probe failure path.
It ensures that if devm_rtc_register_device() fails, the driver properly
jumps to the error handling path to release extclk and pclk resources.
> diff --git a/drivers/rtc/rtc-ftrtc010.c b/drivers/rtc/rtc-ftrtc010.c
> index 02608d3784958..f398d6dc85ae4 100644
> --- a/drivers/rtc/rtc-ftrtc010.c
> +++ b/drivers/rtc/rtc-ftrtc010.c
> @@ -181,7 +181,11 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev)
> if (unlikely(ret))
> goto err_disable_extclk;
>
[Severity: High]
This isn't a bug introduced by this patch, but a pre-existing issue. The
handler is registered with the IRQF_SHARED flag just above this check:
ret = devm_request_irq(dev, rtc->rtc_irq, ftrtc010_rtc_interrupt,
IRQF_SHARED, pdev->name, dev);
However, the interrupt handler unconditionally returns IRQ_HANDLED without
verifying the hardware status:
static irqreturn_t ftrtc010_rtc_interrupt(int irq, void *dev)
{
return IRQ_HANDLED;
}
Can this cause a system lockup if an unhandled interrupt storm occurs on
the shared IRQ line?
If another device shares this line or if the bootloader leaves the RTC
interrupt enabled, the kernel might fail to disable the spurious interrupt
because this handler falsely claims it, starving the CPU.
> - return devm_rtc_register_device(rtc_dev);
> + ret = devm_rtc_register_device(rtc_dev);
> + if (ret)
> + goto err_disable_extclk;
> +
> + return 0;
>
> err_disable_extclk:
> clk_disable_unprepare(rtc->extclk);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260827080320.3351155-1-liudalin@kylinsec.com.cn?part=1
next prev parent reply other threads:[~2026-08-27 8:15 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 1:57 [PATCH] rtc: ftrtc010: fix clock resource leak on probe failure Liu Dalin
2026-08-27 2:10 ` sashiko-bot
2026-08-27 6:30 ` [PATCH v1 0/3] rtc: ftrtc010: fix resource management and integer overflow Liu Dalin
[not found] ` <20260827063019.3342085-1-liudalin@kylinsec.com.cn>
2026-08-27 6:30 ` [PATCH v1 1/3] rtc: ftrtc010: fix clock resource leak on probe failure Liu Dalin
2026-08-27 6:45 ` sashiko-bot
2026-08-27 8:05 ` liudalin
2026-08-27 6:30 ` [PATCH v1 2/3] rtc: ftrtc010: use devm clock APIs to fix use-after-disable in remove Liu Dalin
2026-08-27 6:43 ` sashiko-bot
2026-08-27 8:06 ` liudalin
2026-08-27 6:30 ` [PATCH v1 3/3] rtc: ftrtc010: fix integer overflow in time calculation Liu Dalin
2026-08-27 6:53 ` sashiko-bot
2026-08-27 8:07 ` liudalin
2026-08-27 8:03 ` [PATCH v2 0/3] rtc: ftrtc010: fix resource management and integer overflow Liu Dalin
2026-09-14 8:38 ` Linus Walleij
2026-09-14 9:12 ` liudalin
2026-10-01 10:00 ` Alexandre Belloni
[not found] ` <20260827080320.3351155-1-liudalin@kylinsec.com.cn>
2026-08-27 8:03 ` [PATCH v2 1/3] rtc: ftrtc010: fix clock resource leak on probe failure Liu Dalin
2026-08-27 8:15 ` sashiko-bot [this message]
2026-08-27 8:03 ` [PATCH v2 2/3] rtc: ftrtc010: use devm clock APIs to fix use-after-disable in remove Liu Dalin
2026-08-27 8:15 ` sashiko-bot
2026-08-27 8:03 ` [PATCH v2 3/3] rtc: ftrtc010: fix integer overflow in time calculation Liu Dalin
2026-10-02 10:59 ` Dan Carpenter
2026-08-27 8:17 ` sashiko-bot
2026-10-08 2:10 ` Liu Dalin
2026-09-14 8:35 ` [PATCH] rtc: ftrtc010: fix clock resource leak on probe failure Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260827081528.9D2481F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-rtc@vger.kernel.org \
--cc=liudalin@kylinsec.com.cn \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.