Skip to content

Commit f60b1b4

Browse files
Josef BacikChris Mason
authored andcommitted
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: David Sterba <dave@jikos.cz> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
1 parent 4804b38 commit f60b1b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/extent_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4104,7 +4104,7 @@ struct extent_buffer *alloc_dummy_extent_buffer(u64 start, unsigned long len)
41044104

41054105
return eb;
41064106
err:
4107-
for (i--; i > 0; i--)
4107+
for (i--; i >= 0; i--)
41084108
__free_page(eb->pages[i]);
41094109
__free_extent_buffer(eb);
41104110
return NULL;

0 commit comments

Comments
 (0)