Re: [PATCH v4 10/14] of: reserved-memory: Do not make kmemleak ignore freed address
From: Rob Herring (Arm)
Date: Mon Jan 13 2025 - 18:27:22 EST
On Thu, 09 Jan 2025 21:27:01 +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
>
> early_init_dt_alloc_reserved_memory_arch() will free address @base when
> suffers memblock_mark_nomap() error, but it still makes kmemleak ignore
> the freed address @base via kmemleak_ignore_phys().
>
> That is unnecessary, besides, also causes unnecessary warning messages:
>
> kmemleak_ignore_phys()
> -> make_black_object()
> -> paint_ptr()
> -> kmemleak_warn() // warning message here.
>
> Fix by avoiding kmemleak_ignore_phys() when suffer the error.
>
> Fixes: 658aafc8139c ("memblock: exclude MEMBLOCK_NOMAP regions from kmemleak")
> Signed-off-by: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
> ---
> drivers/of/of_reserved_mem.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Applied, thanks!