Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xfs: fix a memory leak in xfs_buf_item_init()

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>

authored by

Haoxiang Li and committed by
Carlos Maiolino
fc40459d f0672505

+1
+1
fs/xfs/xfs_buf_item.c
··· 896 896 map_size = DIV_ROUND_UP(chunks, NBWORD); 897 897 898 898 if (map_size > XFS_BLF_DATAMAP_SIZE) { 899 + xfs_buf_item_free_format(bip); 899 900 kmem_cache_free(xfs_buf_item_cache, bip); 900 901 xfs_err(mp, 901 902 "buffer item dirty bitmap (%u uints) too small to reflect %u bytes!",