From: Jan Schmidt Date: Tue, 28 May 2013 15:47:22 +0000 (+0000) Subject: Btrfs: fix memory patcher through fs_info->qgroup_ulist X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4373519db4dbca05341a60b28f6e159b106e4c4b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Btrfs: fix memory patcher through fs_info->qgroup_ulist Commit 5b7c665e introduced fs_info->qgroup_ulist, that is allocated during btrfs_read_qgroup_config and meant to be used later by the qgroup accounting code. However, it is always freed before btrfs_read_qgroup_config returns, becuase the commit mentioned above adds a check for (ret), where a check for (ret < 0) would have been the right choice. This commit fixes the check. Cc: Wang Shilong Signed-off-by: Jan Schmidt Signed-off-by: Josef Bacik --- diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index d059d86c3131..74b432d0b703 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -430,7 +430,7 @@ out: } btrfs_free_path(path); - if (ret) + if (ret < 0) ulist_free(fs_info->qgroup_ulist); return ret < 0 ? ret : 0;