[PATCH 4.8 33/85] Btrfs: fix memory leak in do_walk_down
From: Greg Kroah-Hartman
Date: Wed Jan 04 2017 - 16:10:44 EST
4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Bo <bo.li.liu@xxxxxxxxxx>
commit a958eab0ed7fdc1b977bc25d3af6efedaa945488 upstream.
The extent buffer 'next' needs to be free'd conditionally.
Signed-off-by: Liu Bo <bo.li.liu@xxxxxxxxxx>
Reviewed-by: David Sterba <dsterba@xxxxxxxx>
Signed-off-by: David Sterba <dsterba@xxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
fs/btrfs/extent-tree.c | 1 +
1 file changed, 1 insertion(+)
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -8886,6 +8886,7 @@ static noinline int do_walk_down(struct
&wc->flags[level - 1]);
if (ret < 0) {
btrfs_tree_unlock(next);
+ free_extent_buffer(next);
return ret;
}