Re: [PATCH v2 17/25] btrfs-progs: extent-tree: Enhance btrfs_record_file_extent

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

 



On Tue, Dec 01, 2015 at 03:11:37PM +0800, Qu Wenruo wrote:
> --- a/extent-tree.c
> +++ b/extent-tree.c
> +static int __btrfs_record_file_extent(struct btrfs_trans_handle *trans,
> +				      struct btrfs_root *root, u64 objectid,
> +				      struct btrfs_inode_item *inode,
> +				      u64 file_pos, u64 disk_bytenr,
> +				      u64 *ret_num_bytes)
>  {
>  	int ret;
>  	struct btrfs_fs_info *info = root->fs_info;
...
> @@ -3999,25 +4003,80 @@ int btrfs_record_file_extent(struct btrfs_trans_handle *trans,
>  		return ret;
>  	}
>  
> -	btrfs_init_path(&path);
> +	path = btrfs_alloc_path();
> +	if (!path)
> +		return -ENOMEM;
> +
...
>  fail:
> -	btrfs_release_path(&path);
> +	btrfs_release_path(path);
> +	return ret;

Coverity correctly complains that path leaks here.
--
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