From: sashiko-bot@kernel.org
To: "Esteban Urrutia" <esteuwu@proton.me>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 2/4] pinctrl: qcom: Commonize pinctrl-sm8450 headers
Date: Sun, 02 Aug 2026 07:44:36 +0000 [thread overview]
Message-ID: <20260802074436.F12331F00AC4@smtp.kernel.org> (raw)
In-Reply-To: <20260802-sm8475-tlmm-v2-2-a93e1d1cb53b@proton.me>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Moving `enum sm8450_functions` to a shared header creates a brittle design highly susceptible to latent NULL pointer dereferences via array holes.
--
--- Patch [2]: [PATCH v2 2/4] pinctrl: qcom: Commonize pinctrl-sm8450 headers ---
commit f4cf6bf6634b4b995dec36c0bcb15b338f264b61
Author: Esteban Urrutia <esteuwu@proton.me>
pinctrl: qcom: Commonize pinctrl-sm8450 headers
This patch extracts common definitions, including pin groups and
functions, from pinctrl-sm8450.c into a new pinctrl-sm8450.h header.
This prepares the codebase for adding pinctrl support for SM8475, which
shares some of these definitions.
> diff --git a/drivers/pinctrl/qcom/pinctrl-sm8450.h b/drivers/pinctrl/qcom/pinctrl-sm8450.h
> new file mode 100644
> index 0000000000000..7501c694db572
> --- /dev/null
> +++ b/drivers/pinctrl/qcom/pinctrl-sm8450.h
[ ... ]
> +enum sm8450_functions {
> + msm_mux_gpio,
> + msm_mux_aon_cam,
[Severity: Medium]
Could moving this enum to a shared header introduce latent NULL pointer
dereferences via array holes?
If a future patch adds new functions for SM8475 in the middle of this shared
enum to maintain alphabetical order, it will change the enum values for SM8450.
This would leave holes (zero-initialized elements where .name is NULL) in the
designated initializers of the sm8450_functions array.
During probe, msm_pinctrl_setup_pm_reset() in pinctrl-msm.c iterates up to
the highest initialized index:
drivers/pinctrl/qcom/pinctrl-msm.c:msm_pinctrl_setup_pm_reset() {
...
for (i = 0; i < pctrl->soc->nfunctions; i++)
if (!strcmp(func[i].name, "ps_hold")) {
...
}
Because there is no NULL check for func[i].name, iterating over these
uninitialized array holes would crash.
> + msm_mux_atest_char,
> + msm_mux_atest_usb,
> + msm_mux_audio_ref,
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260802-sm8475-tlmm-v2-0-a93e1d1cb53b@proton.me?part=2
next prev parent reply other threads:[~2026-08-02 7:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-02 7:30 [PATCH v2 0/4] Pinctrl support for SM8475 Esteban Urrutia via B4 Relay
2026-08-02 7:30 ` [PATCH v2 1/4] pinctrl: qcom: sm8450: Remove duplicate reference to gpio81 Esteban Urrutia via B4 Relay
2026-08-02 7:30 ` [PATCH v2 2/4] pinctrl: qcom: Commonize pinctrl-sm8450 headers Esteban Urrutia via B4 Relay
2026-08-02 7:44 ` sashiko-bot [this message]
2026-08-02 7:30 ` [PATCH v2 3/4] dt-bindings: pinctrl: qcom,sm8450-tlmm: Add compatible for SM8475 Esteban Urrutia via B4 Relay
2026-08-02 7:40 ` sashiko-bot
2026-08-02 7:30 ` [PATCH v2 4/4] pinctrl: qcom: Add SM8475 pinctrl driver Esteban Urrutia via B4 Relay
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=20260802074436.F12331F00AC4@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=esteuwu@proton.me \
--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