Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c16c2e2e authored by Wang Shilong's avatar Wang Shilong Committed by Josef Bacik
Browse files

Btrfs: fix possible memory leak in the find_parent_nodes()



In the find_parent_nodes(), if read_tree_block() fails, we can
not return directly, we should free some allocated memory otherwise
memory leak happens.

Signed-off-by: default avatarWang Shilong <wangsl-fnst@cn.fujitsu.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
parent 49688107
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -918,7 +918,8 @@ again:
							   ref->parent, bsz, 0);
				if (!eb || !extent_buffer_uptodate(eb)) {
					free_extent_buffer(eb);
					return -EIO;
					ret = -EIO;
					goto out;
				}
				ret = find_extent_in_eb(eb, bytenr,
							*extent_item_pos, &eie);