From: Linus Torvalds Date: Wed, 8 Jun 2011 17:30:03 +0000 (-0700) Subject: isofs: fix bh leak in isofs_fill_super() error case X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c11760c6d80ab6aa20e383cf378a7287305f591c;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git isofs: fix bh leak in isofs_fill_super() error case In isofs_fill_super(), when an iso_primary_descriptor is found, it is kept in pri_bh. The error cases don't properly release it. Fix it. Reported-and-tested-by: 김원석 Cc: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 3db5ba4568fc..b3cc8586984e 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -974,7 +974,7 @@ out_no_inode: out_no_read: printk(KERN_WARNING "%s: bread failed, dev=%s, iso_blknum=%d, block=%d\n", __func__, s->s_id, iso_blknum, block); - goto out_freesbi; + goto out_freebh; out_bad_zone_size: printk(KERN_WARNING "ISOFS: Bad logical zone size %ld\n", sbi->s_log_zone_size); @@ -989,6 +989,7 @@ out_unknown_format: out_freebh: brelse(bh); + brelse(pri_bh); out_freesbi: kfree(opt.iocharset); kfree(sbi);