From: sashiko-bot@kernel.org
To: "Pengpeng Hou" <pengpeng@iscas.ac.cn>
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH] clk: imx: imx8qxp: add missing MODULE_DEVICE_TABLE()
Date: Sun, 05 Jul 2026 00:28:17 +0000 [thread overview]
Message-ID: <20260705002818.59F4E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260705001705.70400-1-pengpeng@iscas.ac.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The driver lacks a `.remove` callback, which leaks CCF clocks on module unload and creates a use-after-free condition.
--
commit 61eb45335ff77dbb9e15e46999a551625f299716
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>
clk: imx: imx8qxp: add missing MODULE_DEVICE_TABLE()
This commit adds the missing MODULE_DEVICE_TABLE() export for the driver's
match table. This ensures module alias information is generated, allowing
for automatic module loading.
> diff --git a/drivers/clk/imx/clk-imx8qxp.c b/drivers/clk/imx/clk-imx8qxp.c
> --- a/drivers/clk/imx/clk-imx8qxp.c
> +++ b/drivers/clk/imx/clk-imx8qxp.c
> @@ -337,6 +337,7 @@ static const struct of_device_id imx8qxp_match[] = {
> { .compatible = "fsl,imx8qm-clk", &imx_clk_scu_rsrc_imx8qm, },
> { /* sentinel */ }
> };
> +MODULE_DEVICE_TABLE(of, imx8qxp_match);
>
> static struct platform_driver imx8qxp_clk_driver = {
> .driver = {
> .name = "imx8qxp-clk",
> .of_match_table = imx8qxp_match,
> .suppress_bind_attrs = true,
> },
> .probe = imx8qxp_clk_probe,
> };
[Severity: High]
This is a pre-existing issue, but does unloading this module create a
use-after-free condition in the Common Clock Framework?
Because imx8qxp_clk_driver lacks a .remove callback, it does not seem to
call of_clk_del_provider() and imx_clk_scu_unregister() when the module
is unloaded. Since these clocks are not devm-managed, do they remain
active in the CCF?
If they stay active after the module is removed via rmmod, won't any
subsequent access to the clock tree trigger a panic, as the clock .ops
pointers will reference unloaded module memory?
Looking at drivers/clk/imx/clk-scu.c, the imx_clk_scu_driver sub-driver
also appears to lack a .remove callback to clean up CCF clocks and memory
when unregistered.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260705001705.70400-1-pengpeng@iscas.ac.cn?part=1
next prev parent reply other threads:[~2026-07-05 0:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-05 0:17 [PATCH] clk: imx: imx8qxp: add missing MODULE_DEVICE_TABLE() Pengpeng Hou
2026-07-05 0:28 ` sashiko-bot [this message]
2026-07-06 15:36 ` Brian Masney
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=20260705002818.59F4E1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=imx@lists.linux.dev \
--cc=pengpeng@iscas.ac.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox