From: Anand Jain Date: Wed, 7 Oct 2015 09:23:23 +0000 (+0800) Subject: Btrfs: add missing brelse when superblock checksum fails X-Git-Tag: v3.12.56~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ec709846fe9fe45a5d128a7e00f2aaa4e597a7f;p=thirdparty%2Fkernel%2Fstable.git Btrfs: add missing brelse when superblock checksum fails 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 Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Jiri Slaby --- diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 3ec1cb0808c30..2622ec8a76f0f 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -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; }