Re: [PATCH] btrfs: dereferencing error pointer in btrfs_quota_enable()

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

 




On  2.08.2018 11:44, Dan Carpenter wrote:
> The error handling in "goto out;" expects that if "trans" is non-NULL
> that means it's valid.  Unfortunately it could also be an error pointer.
> 
> Fixes: c9a6fe84fe43 ("btrfs: qgroups: Move transaction management inside btrfs_quota_enable/disable")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>


Good catch !

Reviewed-by: Nikolay Borisov <nborisov@xxxxxxxx>

> 
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index 3a9019928329..380ff978defa 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -904,6 +904,7 @@ int btrfs_quota_enable(struct btrfs_fs_info *fs_info)
>  	trans = btrfs_start_transaction(tree_root, 2);
>  	if (IS_ERR(trans)) {
>  		ret = PTR_ERR(trans);
> +		trans = NULL;
>  		goto out;
>  	}
>  
> 
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux