On Fri, 2025-05-16 at 13:13 +0800, Li Zhijian wrote:
> kmemleak reported a memleak after the ndctl_test
> unreferenced object 0xffff88800e6cf2c0 (size 32):
>   comm "modprobe", pid 969, jiffies 4294698691
>   hex dump (first 32 bytes):
>     03 00 00 00 a0 0a 00 00 00 b0 b4 00 00 c9 ff ff  ................
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   backtrace (crc 807f3e24):
>     __kmalloc_cache_noprof+0x331/0x410
>     nvdimm_namespace_attach_btt+0xa9b/0xcc0 [nd_btt]
>     platform_probe+0x45/0xa0
>     ...
>     load_module+0x21f9/0x22f0
> 
> faddr2line tells that (based on v6.15-rc4):
> $ ./scripts/faddr2line drivers/nvdimm/nd_btt.o
> nvdimm_namespace_attach_btt+0xa9
> nvdimm_namespace_attach_btt+0xa9b/0xcc0:
> log_set_indices at linux/drivers/nvdimm/btt.c:719
> (inlined by) discover_arenas at linux/drivers/nvdimm/btt.c:888
> (inlined by) btt_init at linux/drivers/nvdimm/btt.c:1583
> (inlined by) nvdimm_namespace_attach_btt at
> linux/drivers/nvdimm/btt.c:1680
> 
> It's believed that this was a false positive because the leaking size
> didn't match any instance in an arena.
> 
> However during looking into this issue, it's noticed that it does not
> release an initializing arena instance and instances in btt-
> >arena_list
> in some error paths.
> 
> Signed-off-by: Li Zhijian <lizhij...@fujitsu.com>
> ---
>  drivers/nvdimm/btt.c | 26 +++++++++++++++++---------
>  1 file changed, 17 insertions(+), 9 deletions(-)

Reviewed-by: Vishal Verma <vishal.l.ve...@intel.com>

Reply via email to