From: Aneesh Kumar K.V Date: Sun, 10 Feb 2008 06:07:28 +0000 (-0500) Subject: ext4: Fix null bh pointer dereference in mballoc X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=42a10add852e6291a7544afd8a286622a3e6ae76;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ext4: Fix null bh pointer dereference in mballoc Repoted by Adrian Bunk : The Coverity checker spotted the following NULL dereference: static int ext4_mb_mark_diskspace_used { ... if (!bitmap_bh) goto out_err; ... out_err: sb->s_dirt = 1; put_bh(bitmap_bh); ... Signed-off-by: Aneesh Kumar K.V Signed-off-by: Mingming Cao --- diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 76e5fedc0a0b..06d1f5292d3a 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3069,7 +3069,7 @@ static int ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, out_err: sb->s_dirt = 1; - put_bh(bitmap_bh); + brelse(bitmap_bh); return err; }