Re: [PATCH 6/6] btrfs-progs: let btrfs_free_path accept NULL

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

 



On 12/19/14 10:06 AM, David Sterba wrote:
> Same in kernel and matches semantics of free().
> 
> Resolves-Coverity-CID: 1054881
> Signed-off-by: David Sterba <dsterba@xxxxxxx>

Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>

> ---
>  ctree.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/ctree.c b/ctree.c
> index bd6cb125b2a2..589efa3db17e 100644
> --- a/ctree.c
> +++ b/ctree.c
> @@ -48,6 +48,8 @@ struct btrfs_path *btrfs_alloc_path(void)
>  
>  void btrfs_free_path(struct btrfs_path *p)
>  {
> +	if (!p)
> +		return;
>  	btrfs_release_path(p);
>  	kfree(p);
>  }
> 

--
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