[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <795ca003-4231-45c0-8bb6-178597950fa5@csgroup.eu>
Date: Tue, 16 Apr 2024 11:32:51 +0000
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Michael Ellerman <mpe@...erman.id.au>, Markus Elfring
<Markus.Elfring@....de>, "linuxppc-dev@...ts.ozlabs.org"
<linuxppc-dev@...ts.ozlabs.org>, "kernel-janitors@...r.kernel.org"
<kernel-janitors@...r.kernel.org>, Aneesh Kumar K.V
<aneesh.kumar@...nel.org>, "Naveen N. Rao" <naveen.n.rao@...ux.ibm.com>,
Nicholas Piggin <npiggin@...il.com>
CC: LKML <linux-kernel@...r.kernel.org>, "cocci@...ia.fr" <cocci@...ia.fr>
Subject: Re: [0/2] powerpc/powernv/vas: Adjustments for two function
implementations
Le 16/04/2024 à 13:11, Michael Ellerman a écrit :
> Markus Elfring <Markus.Elfring@....de> writes:
>>> A few update suggestions were taken into account
>>> from static source code analysis.
>>>
>>> Markus Elfring (2):
>>
>> I would appreciate a bit more information about the reasons
>> why this patch series was rejected.
>>
>>
>>> One function call less in vas_window_alloc() after error detection
>>
>> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/1f1c21cf-c34c-418c-b00c-8e6474f12612@web.de/
>
> It introduced a new goto and label to avoid a kfree(NULL) call, but
> kfree() explicitly accepts NULL and handles it. So it complicates the
> source code for no gain.
This is explicit in Kernel documentation:
/**
* kfree - free previously allocated memory
* @object: pointer returned by kmalloc() or kmem_cache_alloc()
*
* If @object is NULL, no operation is performed.
*/
That's exactly the same behaviour as free() in libc.
So Coccinelle should be fixed if it reports an error for that.
>
>>> Return directly after a failed kasprintf() in map_paste_region()
>>
>> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/f46f04bc-613c-4e98-b602-4c5120556b09@web.de/
>
> Basically the same reasoning. And it also changes the function from
> having two return paths (success and error), to three.
>
Looking at that function, I however see a missing region release when
ioremap_cache() fails.
Christophe
Powered by blists - more mailing lists