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.carpen...@oracle.com>

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 linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to