]> git.ipfire.org Git - thirdparty/linux.git/commit
pnfs/blocklayout: Fix memory leak in bl_parse_scsi()
authorZilin Guan <zilin@seu.edu.cn>
Thu, 25 Dec 2025 08:45:26 +0000 (08:45 +0000)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 5 Jan 2026 04:03:25 +0000 (23:03 -0500)
commit5a74af51c3a6f4cd22c128b0c1c019f68fa90011
treeca2679c845bff754bb06e4ab1f017b2c3b7771a6
parent0c728083654f0066f5e10a1d2b0bd0907af19a58
pnfs/blocklayout: Fix memory leak in bl_parse_scsi()

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: d76c769c8db4c ("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>
fs/nfs/blocklayout/dev.c