diff options
author | Alan Cox <alc@FreeBSD.org> | 2006-01-26 05:51:26 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2006-01-26 05:51:26 +0000 |
commit | cfc26cd69cc56bc4a21d4bdeb60b23dace6b9bb2 (patch) | |
tree | dc099b5d5ce14e94250a09bcf898033e6b4f4837 /sys/vm | |
parent | aed1a1f1797bfd29ae32b8a90346ce37ce4657d3 (diff) | |
download | src-cfc26cd69cc56bc4a21d4bdeb60b23dace6b9bb2.tar.gz src-cfc26cd69cc56bc4a21d4bdeb60b23dace6b9bb2.zip |
Plug a leak in the newer contigmalloc() implementation. Specifically, if
a multipage allocation was aborted midway, the pages that were already
allocated were not always returned to the free list.
Submitted by: tegge
Notes
Notes:
svn path=/head/; revision=154849
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_contig.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index ad98cf9e0609..6208774a318d 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -473,19 +473,14 @@ cleanup_freed: } } if (pqtype == PQ_CACHE) { - if (m->hold_count != 0) { - start = i - npages + 1; - goto retry; - } + if (m->hold_count != 0) + goto cleanup_freed; object = m->object; - if (!VM_OBJECT_TRYLOCK(object)) { - start = i - npages + 1; - goto retry; - } + if (!VM_OBJECT_TRYLOCK(object)) + goto cleanup_freed; if ((m->flags & PG_BUSY) || m->busy != 0) { VM_OBJECT_UNLOCK(object); - start = i - npages + 1; - goto retry; + goto cleanup_freed; } vm_page_free(m); VM_OBJECT_UNLOCK(object); |