Re: [PATCH 6/6] iio: adc: ad5755: drop redundant devm_kfree()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/07/2024 12:52, Jonathan Cameron wrote:
> On Fri, 05 Jul 2024 12:40:49 +0200
> Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> wrote:
> 
>> The driver calls ad5755_parse_fw() only from probe() function, so
>> devm_kfree() during error path is not necessary and only makes code
>> weirder.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
> 
> The path this is in doesn't result in the driver failing to probe as it
> falls back to a const default structure.
> So whilst it's not a 'bug' to remove this free, we are removing data the driver
> is not going to use - so to my eye at least this is a deliberate design
> decision.

Ah, I missed that part - just looked at !pdata in the probe.

> 
> Mind you it's not a particularly big allocation so maybe worth not cleaning
> up until driver remove in order to save on complexity.
> 
> Sean, your code I think.  Do you care either way?

I think the code was correct and my patch can be abandoned.

Best regards,
Krzysztof





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux