From: sashiko-bot@kernel.org
To: "Yu-Chun Lin" <eleanor.lin@realtek.com>
Cc: robh@kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v13 10/11] clk: realtek: Add RTD1625-ISO clock controller driver
Date: Wed, 12 Aug 2026 02:18:13 +0000 [thread overview]
Message-ID: <20260812021813.B9B251F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812020009.3480538-11-eleanor.lin@realtek.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The driver's remove path introduces a NULL pointer dereference window by nullifying the shared syscon regmap while devres-managed clock instances remain globally accessible.
--
--- Patch [10]: [PATCH v13 10/11] clk: realtek: Add RTD1625-ISO clock controller driver ---
commit b3740f40262849e43095598baf79bbd91f8f86bc
Author: Cheng-Yu Lee <cylee12@realtek.com>
clk: realtek: Add RTD1625-ISO clock controller driver
This commit adds support for the ISO domain clock controller on the Realtek
RTD1625 SoC. The controller manages always-on clocks and also registers the
shared reset controller as an auxiliary device.
> diff --git a/drivers/clk/realtek/clk-rtd1625-iso.c b/drivers/clk/realtek/clk-rtd1625-iso.c
> new file mode 100644
> index 0000000000000..6025c148adf83
> --- /dev/null
> +++ b/drivers/clk/realtek/clk-rtd1625-iso.c
[ ... ]
> +static struct platform_driver rtd1625_iso_driver = {
> + .probe = rtd1625_iso_probe,
> + .remove = rtk_clk_remove,
[Severity: High]
Could this lead to a NULL pointer dereference during module unload?
When the module is removed, the driver calls rtk_clk_remove(), which clears
the regmap pointers for all clocks:
drivers/clk/realtek/clk-rtk-common.c:rtk_clk_remove() {
...
for (i = 0; i < desc->num_clks; i++)
desc->clks[i]->regmap = NULL;
...
}
Because the clocks are registered using devres via devm_clk_hw_register(),
they remain registered with the Common Clock Framework until after the remove
function returns.
If something queries the clock state during this window, such as reading from
debugfs (clk_summary), the framework can invoke callbacks that dereference
the nullified regmap pointer:
drivers/clk/realtek/clk-regmap-gate.c:rtk_clk_regmap_gate_is_enabled() {
...
ret = regmap_read(clkg->clkr.regmap, clkg->gate_ofs, &val);
...
}
> + .driver = {
> + .name = "rtk-rtd1625-iso-clk",
> + .of_match_table = rtd1625_iso_match,
> + .suppress_bind_attrs = true,
> + },
> +};
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260812020009.3480538-1-eleanor.lin@realtek.com?part=10
next prev parent reply other threads:[~2026-08-12 2:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 1:59 [PATCH v13 00/11] clk / reset: realtek: Add RTD1625 clock and reset support Yu-Chun Lin
2026-08-12 1:59 ` [PATCH v13 01/11] dt-bindings: clock: Add Realtek RTD1625 Clock & Reset Controller Yu-Chun Lin
2026-08-12 2:00 ` [PATCH v13 02/11] reset: Add Realtek basic reset support Yu-Chun Lin
2026-08-12 2:00 ` [PATCH v13 03/11] reset: realtek: Add RTD1625 reset controller driver Yu-Chun Lin
2026-08-12 2:10 ` sashiko-bot
2026-08-12 2:00 ` [PATCH v13 04/11] clk: realtek: Introduce common probe() and remove() Yu-Chun Lin
2026-08-12 2:08 ` sashiko-bot
2026-08-12 2:00 ` [PATCH v13 05/11] clk: realtek: Add support for phase locked loops (PLLs) Yu-Chun Lin
2026-08-12 2:11 ` sashiko-bot
2026-08-12 2:00 ` [PATCH v13 06/11] clk: realtek: Add support for gate clock Yu-Chun Lin
2026-08-12 2:00 ` [PATCH v13 07/11] clk: realtek: Add support for mux clock Yu-Chun Lin
2026-08-12 2:00 ` [PATCH v13 08/11] clk: realtek: Add support for MMC-tuned PLL clocks Yu-Chun Lin
2026-08-12 2:00 ` [PATCH v13 09/11] clk: realtek: Add RTD1625-CRT clock controller driver Yu-Chun Lin
2026-08-12 2:16 ` sashiko-bot
2026-08-12 2:00 ` [PATCH v13 10/11] clk: realtek: Add RTD1625-ISO " Yu-Chun Lin
2026-08-12 2:18 ` sashiko-bot [this message]
2026-08-12 2:00 ` [PATCH v13 11/11] arm64: dts: realtek: Add clock support for RTD1625 Yu-Chun Lin
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=20260812021813.B9B251F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eleanor.lin@realtek.com \
--cc=linux-clk@vger.kernel.org \
--cc=robh@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