linux/fs/nfs/blocklayout
Zilin Guan 0e036606b2 pnfs/blocklayout: Fix memory leak in bl_parse_scsi()
[ Upstream commit 5a74af51c3 ]

In bl_parse_scsi(), if the block device length is zero, the function
returns immediately without releasing the file reference obtained via
bl_open_path(), leading to a memory leak.

Fix this by jumping to the out_blkdev_put label to ensure the file
reference is properly released.

Fixes: d76c769c8d ("pnfs/blocklayout: Don't add zero-length pnfs_block_dev")
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
..
blocklayout.c pNFS: Fix disk addr range check in block/scsi layout 2025-08-20 18:30:50 +02:00
blocklayout.h nfs/blocklayout: Fix premature PR key unregistration 2024-07-08 13:47:27 -04:00
dev.c pnfs/blocklayout: Fix memory leak in bl_parse_scsi() 2026-01-23 11:18:36 +01:00
extent_tree.c pNFS: Fix uninited ptr deref in block/scsi layout 2025-08-20 18:30:50 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
rpc_pipefs.c rpc_pipefs: Replace one label in bl_resolve_deviceid() 2024-01-04 10:47:56 -05:00