diff options
author | Chris Mason <clm@fb.com> | 2014-05-21 08:49:54 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-06-09 20:20:52 -0400 |
commit | 7d78874273463a784759916fc3e0b4e2eb141c70 (patch) | |
tree | 5f20c29c1b153118d7d26fb7e8928e3821593c44 /fs/btrfs/extent_io.c | |
parent | 58dfae6365666e26cb2d172dc437773120fc4e1a (diff) |
Btrfs: fix double free in find_lock_delalloc_range
We need to NULL the cached_state after freeing it, otherwise
we might free it again if find_delalloc_range doesn't find anything.
Signed-off-by: Chris Mason <clm@fb.com>
cc: stable@vger.kernel.org
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 8285ed0464fa..0f425dea4523 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -1693,6 +1693,7 @@ again: | |||
1693 | * shortening the size of the delalloc range we're searching | 1693 | * shortening the size of the delalloc range we're searching |
1694 | */ | 1694 | */ |
1695 | free_extent_state(cached_state); | 1695 | free_extent_state(cached_state); |
1696 | cached_state = NULL; | ||
1696 | if (!loops) { | 1697 | if (!loops) { |
1697 | max_bytes = PAGE_CACHE_SIZE; | 1698 | max_bytes = PAGE_CACHE_SIZE; |
1698 | loops = 1; | 1699 | loops = 1; |