ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Lukasz Luba <lukasz.luba@arm.com>,
	Amit Kucheria <amitk@kernel.org>,
	Thara Gopinath <thara.gopinath@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Vasily Khoruzhick <anarsoul@gmail.com>,
	Yangtao Li <tiny.windzz@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, Chen-Yu Tsai <wenst@chromium.org>
Subject: Re: [PATCH v3 2/6] thermal: of: Use scoped device node handling to simplify thermal_of_trips_init()
Date: Thu, 10 Oct 2024 19:53:39 +0200	[thread overview]
Message-ID: <3403afd2-20ee-436a-9d3a-22e1c38f78ea@linaro.org> (raw)
In-Reply-To: <20241008123209.00005cee@Huawei.com>

On 08/10/2024 13:32, Jonathan Cameron wrote:
>>  	tt = kzalloc(sizeof(*tt) * count, GFP_KERNEL);
>> -	if (!tt) {
>> -		ret = -ENOMEM;
>> -		goto out_of_node_put;
>> -	}
>> +	if (!tt)
>> +		return ERR_PTR(-ENOMEM);
>>  
>>  	*ntrips = count;
>>  
>> @@ -127,15 +123,11 @@ static struct thermal_trip *thermal_of_trips_init(struct device_node *np, int *n
>>  			goto out_kfree;
>>  	}
>>  
>> -	of_node_put(trips);
>> -
>>  	return tt;
>>  
>>  out_kfree:
>>  	kfree(tt);
> May be worth a follow up to do __free(kfree) on this + a steal for the return.
> Then push the ntrips set until after the populate so it doesn't need resetting to 0.

That's good idea, I'll send v4 with a revised patch (dropping your RB here).

Best regards,
Krzysztof


  reply	other threads:[~2024-10-10 17:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08  9:00 [PATCH v3 0/6] thermal: scope/cleanup.h improvements Krzysztof Kozlowski
2024-10-08  9:00 ` [PATCH v3 1/6] thermal: of: Simplify thermal_of_should_bind with scoped for each OF child Krzysztof Kozlowski
2024-10-08 11:28   ` Jonathan Cameron
2024-10-08  9:00 ` [PATCH v3 2/6] thermal: of: Use scoped device node handling to simplify thermal_of_trips_init() Krzysztof Kozlowski
2024-10-08 11:32   ` Jonathan Cameron
2024-10-10 17:53     ` Krzysztof Kozlowski [this message]
2024-10-08  9:00 ` [PATCH v3 3/6] thermal: of: Use scoped device node handling to simplify of_thermal_zone_find() Krzysztof Kozlowski
2024-10-08 12:21   ` Jonathan Cameron
2024-10-08  9:00 ` [PATCH v3 4/6] thermal: qcom-spmi-adc-tm5: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2024-10-08 12:23   ` Jonathan Cameron
2024-10-08  9:00 ` [PATCH v3 5/6] thermal: tegra: " Krzysztof Kozlowski
2024-10-08 12:24   ` Jonathan Cameron
2024-10-08  9:00 ` [PATCH v3 6/6] thermal: sun8i: Use scoped device node handling to simplify error paths Krzysztof Kozlowski
2024-10-08 12:26   ` Jonathan Cameron

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=3403afd2-20ee-436a-9d3a-22e1c38f78ea@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=amitk@kernel.org \
    --cc=anarsoul@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=samuel@sholland.org \
    --cc=thara.gopinath@gmail.com \
    --cc=thierry.reding@gmail.com \
    --cc=tiny.windzz@gmail.com \
    --cc=wens@csie.org \
    --cc=wenst@chromium.org \
    /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