Re: [PATCH] xfs: fix memory leak for data allocated by xfs_zone_gc_data_alloc()
From: Christoph Hellwig
Date: Fri Apr 17 2026 - 03:58:48 EST
On Fri, Apr 17, 2026 at 12:16:30PM +1000, Wilfred Mallawa wrote:
> From: Wilfred Mallawa <wilfred.mallawa@xxxxxxx>
>
> In xfs_zone_gc_mount(), on error, a struct xfs_zone_gc_data allocated
> with xfs_zone_gc_data_alloc() is freed with kfree(), however, this
> doesn't free the underlying folios or the rmap_irecs.
>
> Use xfs_zone_gc_data_free() to correctly free this memory.
Looks good:
Reviewed-by: Christoph Hellwig <hch@xxxxxx>