]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: fix a memory leak in xfs_buf_item_init()
authorHaoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Wed, 31 Dec 2025 03:15:44 +0000 (22:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:10:07 +0000 (13:10 +0100)
commit0e8bddb3e081dbe9ce271da0227bb96045c3920a
tree6605abf84d7e6dcda6a222a8a6975b06dfbcd1e5
parent06cad7ba5c7bace94eecda930fd8f73cf90dd154
xfs: fix a memory leak in xfs_buf_item_init()

[ Upstream commit fc40459de82543b565ebc839dca8f7987f16f62e ]

xfs_buf_item_get_format() may allocate memory for bip->bli_formats,
free the memory in the error path.

Fixes: c3d5f0c2fb85 ("xfs: complain if anyone tries to create a too-large buffer log item")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
[ Adjust context ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_buf_item.c