Skip to content

Commit

Permalink
isofs: fix bh leak in isofs_fill_super() error case
Browse files Browse the repository at this point in the history
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: 김원석 <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Jun 18, 2011
1 parent a6c0a39 commit c11760c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/isofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
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);
Expand All @@ -989,6 +989,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)

out_freebh:
brelse(bh);
brelse(pri_bh);
out_freesbi:
kfree(opt.iocharset);
kfree(sbi);
Expand Down

0 comments on commit c11760c

Please sign in to comment.