Skip to content

Commit

Permalink
Btrfs: add missing brelse when superblock checksum fails
Browse files Browse the repository at this point in the history
Looks like oversight, call brelse() when checksum fails. Further down the
code, in the non error path, we do call brelse() and so we don't see
brelse() in the goto error paths.

Signed-off-by: Anand Jain <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
asj authored and kdave committed Jan 7, 2016
1 parent 4ef7675 commit b2acddd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2668,6 +2668,7 @@ int open_ctree(struct super_block *sb,
if (btrfs_check_super_csum(bh->b_data)) {
printk(KERN_ERR "BTRFS: superblock checksum mismatch\n");
err = -EINVAL;
brelse(bh);
goto fail_alloc;
}

Expand Down

0 comments on commit b2acddd

Please sign in to comment.