Commit c0109d28 authored by Anand Jain's avatar Anand Jain Committed by Sasha Levin

Btrfs: add missing brelse when superblock checksum fails

[ Upstream commit b2acdddf ]

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: default avatarAnand Jain <anand.jain@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent dd25a5d9
...@@ -2622,6 +2622,7 @@ int open_ctree(struct super_block *sb, ...@@ -2622,6 +2622,7 @@ int open_ctree(struct super_block *sb,
if (btrfs_check_super_csum(bh->b_data)) { if (btrfs_check_super_csum(bh->b_data)) {
printk(KERN_ERR "BTRFS: superblock checksum mismatch\n"); printk(KERN_ERR "BTRFS: superblock checksum mismatch\n");
err = -EINVAL; err = -EINVAL;
brelse(bh);
goto fail_alloc; goto fail_alloc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment