]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: Fix a double free of sbi->s_group_info in ext4_mb_init_backend
authorTao Ma <boyu.mt@taobao.com>
Mon, 11 Jul 2011 22:42:42 +0000 (18:42 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 11 Jul 2011 22:42:42 +0000 (18:42 -0400)
commite250c96da2bd8454e4f499c79d1978127ba276a7
tree880f1cd67f0a8c1fb1dfbb1359358d930b0f611a
parent591a75167c0e798f75af29a260d7f0cf538e46be
ext4: Fix a double free of sbi->s_group_info in ext4_mb_init_backend

If we meet with an error in ext4_mb_add_groupinfo, we kfree
sbi->s_group_info[group >> EXT4_DESC_PER_BLOCK_BITS(sb)], but fail to
reset it to NULL. So the caller ext4_mb_init_backend will try to kfree
it again and causes a double free. So fix it by resetting it to NULL.

Some typo in comments of mballoc.c are also changed.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/mballoc.c