Commit f60b1b49 authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason

Btrfs: fix page leakage

Alloc_dummy_extent_buffer will not free the first page in the eb array if we
fail to allocate a page, fix this.  Thanks,
Reported-by: default avatarDavid Sterba <dave@jikos.cz>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
parent 4804b382
...@@ -4104,7 +4104,7 @@ struct extent_buffer *alloc_dummy_extent_buffer(u64 start, unsigned long len) ...@@ -4104,7 +4104,7 @@ struct extent_buffer *alloc_dummy_extent_buffer(u64 start, unsigned long len)
return eb; return eb;
err: err:
for (i--; i > 0; i--) for (i--; i >= 0; i--)
__free_page(eb->pages[i]); __free_page(eb->pages[i]);
__free_extent_buffer(eb); __free_extent_buffer(eb);
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment