]> 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:19:04 +0000 (22:19 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:12:02 +0000 (13:12 +0100)
commit6d90a061c0910ece3f9dc3e8b4f03c4d2e0cc4db
treea5f9e89f2a17b9e3b6dbdc5dd950dfd1068ea3a2
parentc56231a484d51e99df0b6519ca9d9eed03d40dca
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