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-Tag: v3.10-rc2~7^2^2~16 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=c16c2e2e51c2f0951fffa73c343b8fcb641108ba;p=~emulex%2Finfiniband.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 b4fb4155811..290e347b6db 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);