From: sashiko-bot@kernel.org
To: "Cong Nguyen" <congnt264@gmail.com>
Cc: "Alexandre Belloni" <alexandre.belloni@bootlin.com>,
linux-rtc@vger.kernel.org
Subject: Re: [PATCH v2] rtc: ma35d1: fix unchecked IRQ error and IRQ-before-rtcdev ordering
Date: Fri, 25 Sep 2026 07:30:27 +0000 [thread overview]
Message-ID: <20260925073028.743F41F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260925072345.2632042-1-congnt264@gmail.com>
> platform_get_irq()'s return goes straight into devm_request_irq()'s
> unsigned int param unchecked -- a negative -EPROBE_DEFER becomes a
> huge positive number, so probe fails outright instead of deferring.
>
> The IRQ is also requested before rtc->rtcdev is allocated. devm
> teardown is LIFO, so unbind or a later probe failure frees rtcdev
> before the IRQ, and an alarm firing in that window has
> ma35d1_rtc_interrupt() touch freed memory.
>
> Check irq_num for a negative return, and move the IRQ request to
> right after devm_rtc_allocate_device() (its irqwork is already
> initialized there) and before devm_rtc_register_device(), so unbind
> unregisters the device before the IRQ is freed, not after.
>
> Fixes: dc0684adf3b6 ("rtc: Add driver for Nuvoton ma35d1 rtc controller")
> Reported-by: Sashiko AI review <sashiko-bot@kernel.org>
> Link: https://lore.kernel.org/r/20260918161925.2639130-1-congnt264@gmail.com
> Assisted-by: LLM
> Signed-off-by: Cong Nguyen <congnt264@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260925072345.2632042-1-congnt264@gmail.com?part=1
prev parent reply other threads:[~2026-09-25 7:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 7:23 [PATCH v2] rtc: ma35d1: fix unchecked IRQ error and IRQ-before-rtcdev ordering Cong Nguyen
2026-09-25 7:30 ` sashiko-bot [this message]
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=20260925073028.743F41F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=congnt264@gmail.com \
--cc=linux-rtc@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox