[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <673df61a-e0f5-450b-8fb4-746bc950e3d1@gmail.com>
Date: Wed, 1 May 2024 14:33:39 +0200
From: Vincenzo Mezzela <vincenzo.mezzela@...il.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: sudeep.holla@....com, javier.carrasco.cruz@...il.com,
julia.lawall@...ia.fr, linux-kernel@...r.kernel.org, rafael@...nel.org,
skhan@...uxfoundation.org
Subject: Re: [PATCH 2/2 v3] drivers: use __free attribute instead of
of_node_put()
On 01/05/24 12:48, Greg KH wrote:
> On Wed, May 01, 2024 at 11:43:13AM +0200, Vincenzo Mezzela wrote:
>> Introduce the __free attribute for scope-based resource management.
>> Resources allocated with __free are automatically released at the end of
>> the scope. This enhancement aims to mitigate memory management issues
>> associated with forgetting to release resources by utilizing __free
>> instead of of_node_put().
>>
>> The declaration of the device_node used within the do-while loops is
>> moved directly within the loop so that the resource is automatically
>> freed at the end of each iteration.
>>
>> Suggested-by: Julia Lawall <julia.lawall@...ia.fr>
>> Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@...il.com>
>> ---
>> drivers/base/arch_topology.c | 51 +++++++++++++++---------------------
>> 1 file changed, 21 insertions(+), 30 deletions(-)
> How was all of this tested?
>
> thanks,
>
> greg k-h
Hi,
I just cross-compiled it for RISC-V to enable the config
GENERIC_ARCH_TOPOLOGY
and include arch_topology.c as well.
Do you have any suggestion to trigger the affected code and perform some
testing?
Thanks,
Vincenzo
Powered by blists - more mailing lists