Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Qiang Yu" <qiang.yu@oss.qualcomm.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v5 4/7] clk: qcom: tcsrcc-glymur: Add Mahua QREF regulator support
Date: Tue, 02 Jun 2026 08:39:22 +0000	[thread overview]
Message-ID: <20260602083922.CEB0C1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260602-tcsr_qref_0527-v5-4-8ea174a59d7e@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing NULL check for the return value of device_get_match_data() before dereferencing it, which will cause a kernel panic if the driver is bound manually via sysfs.
--

commit 8ad3e011a368c7747005c2608d2fded352c89aa2
Author: Qiang Yu <qiang.yu@oss.qualcomm.com>

clk: qcom: tcsrcc-glymur: Add Mahua QREF regulator support

This commit adds Mahua-specific regulator arrays and clock descriptor tables.
It updates the probe function to use match_data to select the correct descriptor
table based on the compatible string.

> diff --git a/drivers/clk/qcom/tcsrcc-glymur.c b/drivers/clk/qcom/tcsrcc-glymur.c
> index e317003398d16..deca9b8794b4f 100644
> --- a/drivers/clk/qcom/tcsrcc-glymur.c
> +++ b/drivers/clk/qcom/tcsrcc-glymur.c
[ ... ]
>  static int tcsr_cc_glymur_probe(struct platform_device *pdev)
>  {
> +	const struct tcsrcc_glymur_data *data = device_get_match_data(&pdev->dev);
> +
>  	return qcom_clk_ref_probe(pdev, &tcsr_cc_glymur_regmap_config,
> -				  tcsr_cc_glymur_clk_descs,
> -				  ARRAY_SIZE(tcsr_cc_glymur_clk_descs));
> +				  data->descs, data->num_descs);

[Severity: High]
Will this cause a NULL pointer dereference if the driver is bound manually via
sysfs?

device_get_match_data() returns NULL when a platform driver is manually bound
to a device via sysfs without a matching OF node. Dereferencing data->descs
and data->num_descs here without checking if data is NULL would lead to a
kernel panic in that scenario.

>  }
>  
>  static struct platform_driver tcsr_cc_glymur_driver = {

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260602-tcsr_qref_0527-v5-0-8ea174a59d7e@oss.qualcomm.com?part=4

  reply	other threads:[~2026-06-02  8:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02  8:02 [PATCH v5 0/7] clk: qcom: Add common clkref support and migrate Glymur and Mahua Qiang Yu
2026-06-02  8:02 ` [PATCH v5 1/7] dt-bindings: clock: qcom: Move glymur TCSR to own binding and add mahua Qiang Yu
2026-06-02  8:16   ` sashiko-bot
2026-06-02  8:02 ` [PATCH v5 2/7] clk: qcom: Add generic clkref_en support Qiang Yu
2026-06-02  8:02 ` [PATCH v5 3/7] clk: qcom: tcsrcc-glymur: Migrate tcsr_pcie_N_clkref_en to clk_ref common helper Qiang Yu
2026-06-02  8:02 ` [PATCH v5 4/7] clk: qcom: tcsrcc-glymur: Add Mahua QREF regulator support Qiang Yu
2026-06-02  8:39   ` sashiko-bot [this message]
2026-06-02  8:02 ` [PATCH v5 5/7] arm64: dts: qcom: glymur: Add QREF regulator supplies to TCSR Qiang Yu
2026-06-02  8:48   ` sashiko-bot
2026-06-02  8:02 ` [PATCH v5 6/7] arm64: dts: qcom: mahua: " Qiang Yu
2026-06-02  8:02 ` [PATCH v5 7/7] arm64: dts: qcom: mahua: Switch pcie5_phy ref clock to RPMH_CXO_CLK Qiang Yu

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=20260602083922.CEB0C1F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=qiang.yu@oss.qualcomm.com \
    --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