]> 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, 10 Dec 2025 09:06:01 +0000 (17:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:14:23 +0000 (10:14 +0100)
commit3a07cb7636cd394045fd39492d4161cd6241b830
tree0b186aa6a630276ed592581cac2cfe62722ae98b
parent35ddb0b6240060cc4e70ea1774cd2892106469e1
xfs: fix a memory leak in xfs_buf_item_init()

commit fc40459de82543b565ebc839dca8f7987f16f62e upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_buf_item.c