mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Felix Gu <ustc.gu@gmail.com>
Cc: linux-pm@vger.kernel.org,
	Christian Marangi <ansuelsmth@gmail.com>,
	linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Zhang Rui <rui.zhang@intel.com>
Subject: Re: [PATCH] thermal/drivers/airoha: Fix a device node reference leak in airoha_thermal_probe()
Date: Wed, 28 Jan 2026 16:56:53 +0000	[thread overview]
Message-ID: <900eefbb-1297-4d73-9a60-cee6bf43bd5c@arm.com> (raw)
In-Reply-To: <20260123-airoha-v1-1-ab167bb12fb7@gmail.com>

Hi Felix,

On 1/23/26 11:55, Felix Gu wrote:
> In airoha_thermal_probe() function, chip-scu node is acquired through
> of_parse_phandle(), but it fails to release this reference if
> syscon_node_to_regmap() returns an error.
> Add the missing of_node_put() call to the error path to ensure the
> reference count is properly decremented.
> 
> Fixes: 42de37f40e1b ("thermal/drivers: Add support for Airoha EN7581 thermal sensor")
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
> ---
>   drivers/thermal/airoha_thermal.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/airoha_thermal.c b/drivers/thermal/airoha_thermal.c
> index b9fd6bfc88e5..308ea846ba26 100644
> --- a/drivers/thermal/airoha_thermal.c
> +++ b/drivers/thermal/airoha_thermal.c
> @@ -431,8 +431,10 @@ static int airoha_thermal_probe(struct platform_device *pdev)
>   		return -EINVAL;
>   
>   	priv->chip_scu = syscon_node_to_regmap(chip_scu_np);
> -	if (IS_ERR(priv->chip_scu))
> +	if (IS_ERR(priv->chip_scu)) {
> +		of_node_put(chip_scu_np);
>   		return PTR_ERR(priv->chip_scu);
> +	}
>   
>   	of_address_to_resource(chip_scu_np, 0, &priv->scu_adc_res);
>   	of_node_put(chip_scu_np);

Thank you for the patch, LGTM.

Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>



      reply	other threads:[~2026-01-28 16:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23 11:55 Felix Gu
2026-01-28 16:56 ` Lukasz Luba [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=900eefbb-1297-4d73-9a60-cee6bf43bd5c@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=ansuelsmth@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=ustc.gu@gmail.com \
    /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

all inboxes | Powered by JetHome®