From: Eric Sandeen Date: Sun, 17 Aug 2014 20:09:21 +0000 (-0500) Subject: btrfs: fix leak in qgroup_subtree_accounting() error path X-Git-Tag: omap-fixes-against-v3.17-rc3~41^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3c108950d8e0bfcf48856cc159956022a7ad925;p=pandora-kernel.git btrfs: fix leak in qgroup_subtree_accounting() error path Coverity pointed this out; in the newly added qgroup_subtree_accounting(), if btrfs_find_all_roots() returns an error, we leak at least the parents pointer, and possibly the roots pointer, depending on what failure occurs. If btrfs_find_all_roots() returns an error, we need to free up all allocations before we return. "roots" is initialized to NULL, so it should be safe to free it unconditionally (ulist_free() handles that case). Cc: Mark Fasheh Signed-off-by: Eric Sandeen Reviewed-by: Mark Fasheh Signed-off-by: Chris Mason --- Reading git-diff-tree failed