summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorChris Mason2014-05-21 14:49:54 +0200
committerChris Mason2014-06-10 02:20:52 +0200
commit7d78874273463a784759916fc3e0b4e2eb141c70 (patch)
tree5f20c29c1b153118d7d26fb7e8928e3821593c44 /fs/btrfs/extent_io.c
parentbtrfs: replace simple_strtoull() with kstrtoull() (diff)
downloadkernel-qcow2-linux-7d78874273463a784759916fc3e0b4e2eb141c70.tar.gz
kernel-qcow2-linux-7d78874273463a784759916fc3e0b4e2eb141c70.tar.xz
kernel-qcow2-linux-7d78874273463a784759916fc3e0b4e2eb141c70.zip
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.c1
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:
* 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;