Re: [PATCH] nvdimm-btt: fix a potential memleak in btt_freelist_init

2023-12-09 Thread dinghao . liu
> dinghao.liu@ wrote: > > > Dave Jiang wrote: > > [snip] > > > > That said, this patch does not completely fix freelist from leaking in the > > > following error path. > > > > > > discover_arenas() > > > btt_freelist_init() -> ok (memory allocated) > > > btt_rtt_init() ->

Re: [PATCH] nvdimm-btt: fix a potential memleak in btt_freelist_init

2023-12-08 Thread Ira Weiny
dinghao.liu@ wrote: > > Dave Jiang wrote: [snip] > > That said, this patch does not completely fix freelist from leaking in the > > following error path. > > > > discover_arenas() > > btt_freelist_init() -> ok (memory allocated) > > btt_rtt_init() -> fail > >

Re: [PATCH] nvdimm-btt: fix a potential memleak in btt_freelist_init

2023-12-07 Thread dinghao . liu
> Dave Jiang wrote: > > > > [snip] > > First off thanks for the patch. This code seems to have a few things to > clean up. > > > > > On 12/6/23 20:43, Dinghao Liu wrote: > > > When an error happens in btt_freelist_init(), its caller > > > discover_arenas() will directly free arena, which

Re: [PATCH] nvdimm-btt: fix a potential memleak in btt_freelist_init

2023-12-07 Thread Ira Weiny
Dave Jiang wrote: > [snip] First off thanks for the patch. This code seems to have a few things to clean up. > > On 12/6/23 20:43, Dinghao Liu wrote: > > When an error happens in btt_freelist_init(), its caller > > discover_arenas() will directly free arena, which makes > > arena->freelist

Re: [PATCH] nvdimm-btt: fix a potential memleak in btt_freelist_init

2023-12-07 Thread Dave Jiang
On 12/6/23 20:43, Dinghao Liu wrote: > When an error happens in btt_freelist_init(), its caller > discover_arenas() will directly free arena, which makes > arena->freelist allocated in btt_freelist_init() a leaked > memory. Fix this by freeing arena->freelist in all error > handling paths of