Skip to content

Commit

Permalink
Btrfs: fix double free in find_lock_delalloc_range
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Chris Mason committed Jun 10, 2014
1 parent 58dfae6 commit 7d78874
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,7 @@ STATIC u64 find_lock_delalloc_range(struct inode *inode,
* shortening the size of the delalloc range we're searching
*/
free_extent_state(cached_state);
cached_state = NULL;
if (!loops) {
max_bytes = PAGE_CACHE_SIZE;
loops = 1;
Expand Down

0 comments on commit 7d78874

Please sign in to comment.