On Tue, Apr 19, 2011 at 09:49:43AM -0600, Artur Grabowski wrote:
> Free the correct memory when we failed to allocate va.
ok ariane@
> Index: uvm/uvm_km.c
> ===================================================================
> RCS file: /cvs/src/sys/uvm/uvm_km.c,v
> retrieving revision 1.97
> diff -u -r1.97 uvm_km.c
> --- uvm/uvm_km.c 18 Apr 2011 19:23:46 -0000 1.97
> +++ uvm/uvm_km.c 19 Apr 2011 15:46:45 -0000
> @@ -928,7 +928,8 @@
> while (uvm_km_pages.free == 0) {
> if (kd->kd_waitok == 0) {
> mtx_leave(&uvm_km_pages.mtx);
> - uvm_pagefree(pg);
> + if (!TAILQ_EMPTY(&pgl))
> + uvm_pglistfree(&pgl);
> return NULL;
> }
> msleep(&uvm_km_pages.free, &uvm_km_pages.mtx, PVM,
> @@ -961,6 +962,8 @@
> tsleep(map, PVM, "km_allocva", 0);
> goto try_map;
> }
> + if (!TAILQ_EMPTY(&pgl))
> + uvm_pglistfree(&pgl);
> return (NULL);
> }
> }
>
--
Ariane