All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yu-Chun Lin" <eleanor.lin@realtek.com>
Cc: devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v13 03/11] reset: realtek: Add RTD1625 reset controller driver
Date: Wed, 12 Aug 2026 02:10:28 +0000	[thread overview]
Message-ID: <20260812021029.3938B1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812020009.3480538-4-eleanor.lin@realtek.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing validation of `dev_get_platdata()` return value, leading to a potential NULL pointer dereference in reset operations.
--

--- Patch [3]: [PATCH v13 03/11] reset: realtek: Add RTD1625 reset controller driver ---
commit 789f70d6384140bb43211f942b168ac28816b10c
Author: Cheng-Yu Lee <cylee12@realtek.com>

reset: realtek: Add RTD1625 reset controller driver

This commit adds support for the CRT and ISO domain reset controller on
the Realtek RTD1625 SoC. The reset driver is implemented as an auxiliary
driver to handle shared register space with the clock controller.

> diff --git a/drivers/reset/realtek/reset-rtd1625.c b/drivers/reset/realtek/reset-rtd1625.c
> new file mode 100644
> index 0000000000000..479b3a94d2b5a
> --- /dev/null
> +++ b/drivers/reset/realtek/reset-rtd1625.c

[ ... ]

> +static int rtd1625_reset_probe(struct auxiliary_device *adev,
> +			       const struct auxiliary_device_id *id)
> +{
> +	const struct rtd1625_reset_info *info;
> +	struct device *dev = &adev->dev;
> +	struct rtk_reset_data *data;
> +
> +	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
> +	if (!data)
> +		return -ENOMEM;
> +
> +	info = (const struct rtd1625_reset_info *)id->driver_data;
> +
> +	data->descs           = info->descs;
> +	data->regmap          = dev_get_platdata(dev);

[Severity: Medium]
Should there be a check to ensure dev_get_platdata() does not return NULL?

If the parent clock controller driver fails to populate the platform data
for the auxiliary device before adding it to the auxiliary bus, this could
lead to a NULL pointer being assigned to data->regmap. This might result
in a kernel panic during later reset operations (such as assert or deassert)
when the regmap is dereferenced by rtk_reset_ops.

> +	data->rcdev.owner     = THIS_MODULE;
> +	data->rcdev.nr_resets = info->nr_resets;
> +	data->rcdev.ops       = &rtk_reset_ops;
> +	data->rcdev.dev       = dev;
> +	data->rcdev.of_node   = dev->of_node;
> +
> +	return devm_reset_controller_register(dev, &data->rcdev);
> +}

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260812020009.3480538-1-eleanor.lin@realtek.com?part=3

  reply	other threads:[~2026-08-12  2:10 UTC|newest]

Thread overview: 18+ 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  8:48   ` Krzysztof Kozlowski
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 [this message]
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
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=20260812021029.3938B1F000E9@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 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.