From: Wang Shilong Date: Wed, 8 May 2013 08:10:25 +0000 (+0000) Subject: Btrfs: fix possible memory leak in the find_parent_nodes() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c16c2e2e51c2f0951fffa73c343b8fcb641108ba;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Wang Shilong Signed-off-by: Josef Bacik --- diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index b4fb41558111..290e347b6db3 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -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);