linux/fs/nfs/flexfilelayout
Zilin Guan 86da7efd12 pnfs/flexfiles: Fix memory leak in nfs4_ff_alloc_deviceid_node()
[ Upstream commit 0c72808365 ]

In nfs4_ff_alloc_deviceid_node(), if the allocation for ds_versions fails,
the function jumps to the out_scratch label without freeing the already
allocated dsaddrs list, leading to a memory leak.

Fix this by jumping to the out_err_drain_dsaddrs label, which properly
frees the dsaddrs list before cleaning up other resources.

Fixes: d67ae825a5 ("pnfs/flexfiles: Add the FlexFile Layout Driver")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-01-23 11:18:36 +01:00
..
flexfilelayout.c NFSv4/flexfiles: Fix layout merge mirror check. 2025-09-19 16:35:44 +02:00
flexfilelayout.h NFS/flexfiles: Annotate struct nfs4_ff_layout_segment with __counted_by 2023-10-02 09:48:53 -07:00
flexfilelayoutdev.c pnfs/flexfiles: Fix memory leak in nfs4_ff_alloc_deviceid_node() 2026-01-23 11:18:36 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00