Re: [PATCH] btrfs: handle errors returned from get_tree_block_key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 24, 2013 at 06:51:34PM +0200, David Sterba wrote:
> Signed-off-by: David Sterba <dsterba@xxxxxxx>
> ---
>  fs/btrfs/relocation.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
> index c22ccfe..e85be23 100644
> --- a/fs/btrfs/relocation.c
> +++ b/fs/btrfs/relocation.c
> @@ -2878,8 +2878,11 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans,
>  	rb_node = rb_first(blocks);
>  	while (rb_node) {
>  		block = rb_entry(rb_node, struct tree_block, rb_node);
> -		if (!block->key_ready)
> -			get_tree_block_key(rc, block);
> +		if (!block->key_ready) {
> +			err = get_tree_block_key(rc, block);
> +			if (err)
> +				goto out_path;
> +		}

Doesn't this leak the path?  Whoever named that label out_path was
having a laugh :).

		btrfs_free_path(path);
	out_path:
		free_block_list(blocks);
		return err;
	}

- z
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux