From: Filipe David Borba Manana Date: Mon, 9 Sep 2013 18:49:43 +0000 (+0100) Subject: Btrfs: don't leak block group on error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e84cc14213e2c81ae5a2da341a9da0d58a1dbfad;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git Btrfs: don't leak block group on error In extent-tree.c:btrfs_write_dirty_block_groups(), if the call to write_one_cache_group() failed, we would return without putting the block group first. Signed-off-by: Filipe David Borba Manana Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 55b537fcb81a..54ee542c705e 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3317,10 +3317,9 @@ again: last = cache->key.objectid + cache->key.offset; err = write_one_cache_group(trans, root, path, cache); + btrfs_put_block_group(cache); if (err) /* File system offline */ goto out; - - btrfs_put_block_group(cache); } while (1) {