]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Btrfs: add missing brelse when superblock checksum fails
authorAnand Jain <anand.jain@oracle.com>
Wed, 7 Oct 2015 09:23:23 +0000 (17:23 +0800)
committerJiri Slaby <jslaby@suse.cz>
Thu, 3 Mar 2016 11:46:00 +0000 (12:46 +0100)
commit b2acdddfad13c38a1e8b927d83c3cf321f63601a upstream.

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 <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/btrfs/disk-io.c

index 3ec1cb0808c30afec4059c68fedd1fc0509e4749..2622ec8a76f0f2b14e44fc77b4ff3024981a9689 100644 (file)
@@ -2340,6 +2340,7 @@ int open_ctree(struct super_block *sb,
        bh = btrfs_read_dev_super(fs_devices->latest_bdev);
        if (!bh) {
                err = -EINVAL;
+               brelse(bh);
                goto fail_alloc;
        }