Skip to content

Commit a8728d3

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/hfsplus
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/hfsplus: hfsplus: Fix double iput of the same inode in hfsplus_fill_super() hfsplus: add missing call to bio_put()
2 parents fe0d422 + 032016a commit a8728d3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

fs/hfsplus/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
500500
out_put_hidden_dir:
501501
iput(sbi->hidden_dir);
502502
out_put_root:
503-
iput(sbi->alloc_file);
503+
iput(root);
504504
out_put_alloc_file:
505505
iput(sbi->alloc_file);
506506
out_close_cat_tree:

fs/hfsplus/wrapper.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ int hfsplus_submit_bio(struct block_device *bdev, sector_t sector,
3636
{
3737
DECLARE_COMPLETION_ONSTACK(wait);
3838
struct bio *bio;
39+
int ret = 0;
3940

4041
bio = bio_alloc(GFP_NOIO, 1);
4142
bio->bi_sector = sector;
@@ -54,8 +55,10 @@ int hfsplus_submit_bio(struct block_device *bdev, sector_t sector,
5455
wait_for_completion(&wait);
5556

5657
if (!bio_flagged(bio, BIO_UPTODATE))
57-
return -EIO;
58-
return 0;
58+
ret = -EIO;
59+
60+
bio_put(bio);
61+
return ret;
5962
}
6063

6164
static int hfsplus_read_mdb(void *bufptr, struct hfsplus_wd *wd)

0 commit comments

Comments
 (0)