From: sashiko-bot@kernel.org
To: "Miquel Raynal" <miquel.raynal@bootlin.com>
Cc: linux-clk@vger.kernel.org
Subject: Re: [PATCH] clk: nuvoton: ma35d1: Use clk_hw pointers as mux parents
Date: Fri, 14 Aug 2026 07:28:28 +0000 [thread overview]
Message-ID: <20260814072828.EDAE41F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260813-perso-ma35d1-upstream-clk-v1-1-e78e5e6172ea@bootlin.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing IS_ERR() check when retrieving clk_hw pointers for mux parents leads to a kernel panic if a parent clock failed to register.
--
--- Patch [1]: [PATCH] clk: nuvoton: ma35d1: Use clk_hw pointers as mux parents ---
Note: The format of this report has been altered to a free-form summary due
to automated recitation restrictions. Inline diffs are omitted.
commit cb1ab325c1866a1de7e5ffdc22cd1339fb87557f
Author: Miquel Raynal <miquel.raynal@bootlin.com>
Subject: clk: nuvoton: ma35d1: Use clk_hw pointers as mux parents
This patch updates the MA35D1 clock provider to use direct HW clock pointers
for parent lookups instead of string-based lookups, fixing flat clock trees
and unassigned frequencies.
[Severity: High]
Could this lead to a kernel panic if a parent clock registration fails?
In drivers/clk/nuvoton/clk-ma35d1.c, within the ma35d1_clk_mux() function,
the code iterates over num_parents and assigns hws[parent_idx[i]] to the
parent_hws array.
If a preceding clock registration function (like ma35d1_reg_clk_pll or
ma35d1_clk_fixed) fails, it will return an ERR_PTR which gets stored in the
hws array. Because ma35d1_clk_mux() copies these pointers into parent_hws
without an IS_ERR check, the ERR_PTR is handed off to the clock core.
Since the common clock framework treats any non-NULL pointer as valid, won't
this result in an invalid memory dereference when clk_core_fill_parent_index()
attempts to access parent->hw->core?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260813-perso-ma35d1-upstream-clk-v1-1-e78e5e6172ea@bootlin.com?part=1
prev parent reply other threads:[~2026-08-14 7:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 7:28 [PATCH] clk: nuvoton: ma35d1: Use clk_hw pointers as mux parents Miquel Raynal
2026-08-14 7:28 ` 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=20260814072828.EDAE41F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--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.