add patch avoid-memory-leak-of-s_journal_flag_rwsem-on-error-path
[ext4-patch-queue.git] / avoid-possible-double-brelse-in-add_new_gdb-on-error-path
blob492177c2e38369383d22952af66a6b9817fc0af8
1 ext4: avoid possible double brelse() in add_new_gdb() on error path
3 Fixes: b40971426a83 ("ext4: add error checking to calls to ...")
4 Reported-by: Vasily Averin <vvs@virtuozzo.com>
5 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 Cc: stable@kernel.org # 2.6.38
7 ---
8  fs/ext4/resize.c | 1 +
9  1 file changed, 1 insertion(+)
11 diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
12 index 85158e9de7c2..a5efee34415f 100644
13 --- a/fs/ext4/resize.c
14 +++ b/fs/ext4/resize.c
15 @@ -871,6 +871,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
16         err = ext4_handle_dirty_metadata(handle, NULL, gdb_bh);
17         if (unlikely(err)) {
18                 ext4_std_error(sb, err);
19 +               iloc.bh = NULL;
20                 goto exit_inode;
21         }
22         brelse(dind);