From: sashiko-bot@kernel.org
To: "Ronald Claveau" <linux-kernel-dev@aliel.fr>
Cc: linux-amlogic@lists.infradead.org, conor+dt@kernel.org,
robh@kernel.org, lee@kernel.org, mfd@lists.linux.dev,
devicetree@vger.kernel.org, neil.armstrong@linaro.org
Subject: Re: [PATCH v12 4/6] thermal: khadas-mcu-fan: Add fan config from platform data Add regulator support
Date: Thu, 17 Sep 2026 08:13:09 +0000 [thread overview]
Message-ID: <20260917081309.8FBD21F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260917-add-mcu-fan-khadas-vim4-v12-4-497cd543a148@aliel.fr>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] thermal: khadas-mcu-fan: OF node reference leak in probe
--
commit c3a0644be46518f47124644a90235d26979c4299
Author: Ronald Claveau <linux-kernel-dev@aliel.fr>
thermal: khadas-mcu-fan: Add fan config from platform data Add regulator support
This commit introduces variant-specific platform data including control
registers and duty-cycle levels, while also bumping the maximum level.
It optionally acquires and enables a fan regulator supply at probe time
to handle boards that gate fan power.
> diff --git a/drivers/thermal/khadas_mcu_fan.c b/drivers/thermal/khadas_mcu_fan.c
> index 21b3d0a71bd0d..1da639d054971 100644
> --- a/drivers/thermal/khadas_mcu_fan.c
> +++ b/drivers/thermal/khadas_mcu_fan.c
[ ... ]
> @@ -76,22 +82,71 @@ static const struct thermal_cooling_device_ops khadas_mcu_fan_cooling_ops = {
> static int khadas_mcu_fan_probe(struct platform_device *pdev)
> {
> + const struct platform_device_id *id = platform_get_device_id(pdev);
> struct khadas_mcu *mcu = dev_get_drvdata(pdev->dev.parent);
> struct thermal_cooling_device *cdev;
> struct device *dev = &pdev->dev;
> struct khadas_mcu_fan_ctx *ctx;
> int ret;
>
> +
> + if (!dev->of_node)
> + dev->of_node = of_node_get(dev->parent->of_node);
[Severity: Medium]
Does this leak the OF node reference? The probe function explicitly
acquires the node with of_node_get() and assigns it to dev->of_node,
but there is no corresponding cleanup mechanism.
Since there is no .remove callback or devm action registered to call
of_node_put(), and the driver core does not automatically drop
references assigned directly to dev->of_node in this manner, the
reference count appears to leak every time the driver is unbound.
> +
> + if (!id)
> + return -EINVAL;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260917-add-mcu-fan-khadas-vim4-v12-0-497cd543a148@aliel.fr?part=4
WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Ronald Claveau" <linux-kernel-dev@aliel.fr>
Cc: linux-amlogic@lists.infradead.org, conor+dt@kernel.org,
robh@kernel.org, lee@kernel.org, mfd@lists.linux.dev,
devicetree@vger.kernel.org, neil.armstrong@linaro.org
Subject: Re: [PATCH v12 4/6] thermal: khadas-mcu-fan: Add fan config from platform data Add regulator support
Date: Thu, 17 Sep 2026 08:13:09 +0000 [thread overview]
Message-ID: <20260917081309.8FBD21F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260917-add-mcu-fan-khadas-vim4-v12-4-497cd543a148@aliel.fr>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] thermal: khadas-mcu-fan: OF node reference leak in probe
--
commit c3a0644be46518f47124644a90235d26979c4299
Author: Ronald Claveau <linux-kernel-dev@aliel.fr>
thermal: khadas-mcu-fan: Add fan config from platform data Add regulator support
This commit introduces variant-specific platform data including control
registers and duty-cycle levels, while also bumping the maximum level.
It optionally acquires and enables a fan regulator supply at probe time
to handle boards that gate fan power.
> diff --git a/drivers/thermal/khadas_mcu_fan.c b/drivers/thermal/khadas_mcu_fan.c
> index 21b3d0a71bd0d..1da639d054971 100644
> --- a/drivers/thermal/khadas_mcu_fan.c
> +++ b/drivers/thermal/khadas_mcu_fan.c
[ ... ]
> @@ -76,22 +82,71 @@ static const struct thermal_cooling_device_ops khadas_mcu_fan_cooling_ops = {
> static int khadas_mcu_fan_probe(struct platform_device *pdev)
> {
> + const struct platform_device_id *id = platform_get_device_id(pdev);
> struct khadas_mcu *mcu = dev_get_drvdata(pdev->dev.parent);
> struct thermal_cooling_device *cdev;
> struct device *dev = &pdev->dev;
> struct khadas_mcu_fan_ctx *ctx;
> int ret;
>
> +
> + if (!dev->of_node)
> + dev->of_node = of_node_get(dev->parent->of_node);
[Severity: Medium]
Does this leak the OF node reference? The probe function explicitly
acquires the node with of_node_get() and assigns it to dev->of_node,
but there is no corresponding cleanup mechanism.
Since there is no .remove callback or devm action registered to call
of_node_put(), and the driver core does not automatically drop
references assigned directly to dev->of_node in this manner, the
reference count appears to leak every time the driver is unbound.
> +
> + if (!id)
> + return -EINVAL;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260917-add-mcu-fan-khadas-vim4-v12-0-497cd543a148@aliel.fr?part=4
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2026-09-17 8:13 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 7:58 [PATCH v12 0/6] Add VIM4 MCU/FAN support Ronald Claveau via B4 Relay
2026-09-17 7:58 ` Ronald Claveau via B4 Relay
2026-09-17 7:58 ` Ronald Claveau
2026-09-17 7:59 ` [PATCH v12 1/6] mfd: khadas-mcu: Add per-variant configuration infrastructure and VIM4 support Ronald Claveau via B4 Relay
2026-09-17 7:59 ` Ronald Claveau via B4 Relay
2026-09-17 7:59 ` Ronald Claveau
2026-09-17 8:06 ` sashiko-bot
2026-09-17 8:06 ` sashiko-bot
2026-09-17 7:59 ` [PATCH v12 2/6] mfd: khadas-mcu: Use MFD_CELL_* macros for cell declarations Ronald Claveau via B4 Relay
2026-09-17 7:59 ` Ronald Claveau via B4 Relay
2026-09-17 7:59 ` Ronald Claveau
2026-09-17 8:07 ` sashiko-bot
2026-09-17 8:07 ` sashiko-bot
2026-09-18 9:05 ` Neil Armstrong
2026-09-18 9:05 ` Neil Armstrong
2026-09-17 7:59 ` [PATCH v12 3/6] mfd: khadas-mcu: Add support for VIM4 MCU variant Ronald Claveau via B4 Relay
2026-09-17 7:59 ` Ronald Claveau via B4 Relay
2026-09-17 7:59 ` Ronald Claveau
2026-09-17 8:11 ` sashiko-bot
2026-09-17 8:11 ` sashiko-bot
2026-09-18 8:46 ` Ronald Claveau
2026-09-18 8:46 ` Ronald Claveau
2026-09-17 7:59 ` [PATCH v12 4/6] thermal: khadas-mcu-fan: Add fan config from platform data Add regulator support Ronald Claveau via B4 Relay
2026-09-17 7:59 ` Ronald Claveau via B4 Relay
2026-09-17 7:59 ` Ronald Claveau
2026-09-17 8:13 ` sashiko-bot [this message]
2026-09-17 8:13 ` sashiko-bot
2026-09-18 8:54 ` Ronald Claveau
2026-09-18 8:54 ` Ronald Claveau
2026-09-18 9:12 ` Daniel Lezcano
2026-09-18 9:12 ` Daniel Lezcano
2026-09-17 7:59 ` [PATCH v12 5/6] arm64: dts: amlogic: t7: Add i2c controller node Ronald Claveau via B4 Relay
2026-09-17 7:59 ` Ronald Claveau via B4 Relay
2026-09-17 7:59 ` Ronald Claveau
2026-09-17 8:03 ` sashiko-bot
2026-09-17 8:03 ` sashiko-bot
2026-09-17 7:59 ` [PATCH v12 6/6] arm64: dts: amlogic: t7: khadas-vim4: Add i2c MCU fan node Ronald Claveau via B4 Relay
2026-09-17 7:59 ` Ronald Claveau via B4 Relay
2026-09-17 7:59 ` Ronald Claveau
2026-09-17 8:08 ` sashiko-bot
2026-09-17 8:08 ` sashiko-bot
2026-09-23 11:13 ` (subset) [PATCH v12 0/6] Add VIM4 MCU/FAN support Lee Jones
2026-09-23 11:13 ` Lee Jones
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=20260917081309.8FBD21F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lee@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-kernel-dev@aliel.fr \
--cc=mfd@lists.linux.dev \
--cc=neil.armstrong@linaro.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.