diff options
author | Josef Bacik <jbacik@fusionio.com> | 2012-10-05 22:53:34 +0200 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2012-10-09 15:20:56 +0200 |
commit | f60b1b49f6f72abb8bedfd49b758773bbda043c8 (patch) | |
tree | 34e972598969d614eca15082588e8b9ee38d8471 /fs/btrfs | |
parent | Btrfs: do not warn_on when we cannot alloc a page for an extent buffer (diff) | |
download | linux-f60b1b49f6f72abb8bedfd49b758773bbda043c8.tar.xz linux-f60b1b49f6f72abb8bedfd49b758773bbda043c8.zip |
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/extent_io.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 7dc69b38548d..64dc93f64bc0 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -4104,7 +4104,7 @@ struct extent_buffer *alloc_dummy_extent_buffer(u64 start, unsigned long len) return eb; err: - for (i--; i > 0; i--) + for (i--; i >= 0; i--) __free_page(eb->pages[i]); __free_extent_buffer(eb); return NULL; |