Re: [PATCH v3 4/5] mm/slab: Add __free() support for kvfree

From: Greg Kroah-Hartman
Date: Wed Aug 30 2023 - 18:43:50 EST


On Wed, Aug 30, 2023 at 12:33:36PM -0700, Dan Williams wrote:
> Allow for the declaration of variables that trigger kvfree() when they
> go out of scope. The check for NULL and call to kvfree() can be elided
> by the compiler in most cases, otherwise without the NULL check an
> unnecessary call to kvfree() may be emitted. Peter proposed a comment
> for this detail [1].
>
> Link: http://lore.kernel.org/r/20230816103102.GF980931@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [1]
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
> ---
> include/linux/slab.h | 2 ++
> 1 file changed, 2 insertions(+)

Acked-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>