diff options
author | Wang Shilong <wangsl-fnst@cn.fujitsu.com> | 2013-05-08 04:10:25 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-05-17 21:40:17 -0400 |
commit | c16c2e2e51c2f0951fffa73c343b8fcb641108ba (patch) | |
tree | 4d4fe921e979bf12c98f488362afa45c5cd18429 /fs/btrfs | |
parent | 49688107527a24b0ed3780576257a1225902180b (diff) |
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 <wangsl-fnst@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/backref.c | 3 |
1 files changed, 2 insertions, 1 deletions
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: | |||
918 | ref->parent, bsz, 0); | 918 | ref->parent, bsz, 0); |
919 | if (!eb || !extent_buffer_uptodate(eb)) { | 919 | if (!eb || !extent_buffer_uptodate(eb)) { |
920 | free_extent_buffer(eb); | 920 | free_extent_buffer(eb); |
921 | return -EIO; | 921 | ret = -EIO; |
922 | goto out; | ||
922 | } | 923 | } |
923 | ret = find_extent_in_eb(eb, bytenr, | 924 | ret = find_extent_in_eb(eb, bytenr, |
924 | *extent_item_pos, &eie); | 925 | *extent_item_pos, &eie); |