From: Theodore Ts'o Date: Mon, 10 Jan 2011 17:51:28 +0000 (-0500) Subject: ext4: fix memory leak in ext4_free_branches X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1c5b9e9065567876c2d4a7a16d78f0fed154a5bf;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ext4: fix memory leak in ext4_free_branches Commit 40389687 moved a call to ext4_forget() out of ext4_free_branches and let ext4_free_blocks() handle calling bforget(). But that change unfortunately did not replace the call to ext4_forget() with brelse(), which was needed to drop the in-use count of the indirect block's buffer head, which lead to a memory leak when deleting files that used indirect blocks. Fix this. Thanks to Hugh Dickins for pointing this out. Cc: stable@kernel.org Signed-off-by: "Theodore Ts'o" --- diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 84b616269265..e80fc513eacc 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4378,6 +4378,7 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode, (__le32 *) bh->b_data, (__le32 *) bh->b_data + addr_per_block, depth); + brelse(bh); /* * Everything below this this pointer has been