[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1c2117f1-2d22-4d08-bd9f-8c821d4a1757@intel.com>
Date: Fri, 13 Oct 2023 19:18:37 +0200
From: "Wilczynski, Michal" <michal.wilczynski@...el.com>
To: Dan Williams <dan.j.williams@...el.com>, <nvdimm@...ts.linux.dev>,
<linux-acpi@...r.kernel.org>
CC: <rafael@...nel.org>, <vishal.l.verma@...el.com>, <lenb@...nel.org>,
<dave.jiang@...el.com>, <ira.weiny@...el.com>,
<linux-kernel@...r.kernel.org>,
Andy Shevchenko <andy.shevchenko@...il.com>
Subject: Re: [PATCH v2] ACPI: NFIT: Fix local use of devm_*()
On 10/13/2023 7:05 PM, Dan Williams wrote:
> Wilczynski, Michal wrote:
>> On 10/13/2023 6:38 PM, Dan Williams wrote:
>>> Michal Wilczynski wrote:
>>>> devm_*() family of functions purpose is managing memory attached to a
>>>> device. So in general it should only be used for allocations that should
>>>> last for the whole lifecycle of the device.
>>> No, this assertion is not accurate, if it were strictly true then
>>> devm_kfree() should be deleted. This patch is only a cleanup to switch
>>> the automatic cleanup pattern from devm to the new cleanup.h helpers.
>> The memory in question is only used locally in a function, so there is no reason
>> to use devm_*() family of functions. I think devm_kfree() is more for special
>> cases where the memory is meant to be used for the whole lifecycle of device,
>> but some special case occurs and it's not and it needs to be freed.
>>
>> This is an incorrect API usage. Would you propose to change all memory
>> allocations currently being done to devm_*() family simply because devm_kfree()
>> exists ?
> Michal, please work with someone else to get these cleanups upstream, I
> am done with this thread.
I'm really sorry if I offended you, I didn't mean to.
MichaĆ
Powered by blists - more mailing lists