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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Mar 2016 23:06:22 +0000 (15:06 -0800)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/disk-io.c

index 7360f03ddbe1656d067912afe7414c64dbe86d71..9612a01198df93f2a2c27281f1225e96412d052f 100644 (file)
@@ -2437,6 +2437,7 @@ int open_ctree(struct super_block *sb,
                       "unsupported option features (%Lx).\n",
                       (unsigned long long)features);
                err = -EINVAL;
+               brelse(bh);
                goto fail_alloc;
        }