Don't leak memory on failure in uvm_pglistalloc_contig.

Free pages like uvm_pglistalloc_simple does.

Discovered by code inspection.
This commit is contained in:
riastradh 2014-05-19 05:24:29 +00:00
parent 19429f513e
commit 1b07394016

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_pglist.c,v 1.63 2013/09/15 15:54:23 martin Exp $ */
/* $NetBSD: uvm_pglist.c,v 1.64 2014/05/19 05:24:29 riastradh Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.63 2013/09/15 15:54:23 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.64 2014/05/19 05:24:29 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -354,6 +354,8 @@ out:
uvm_kick_pdaemon();
mutex_spin_exit(&uvm_fpageqlock);
if (error)
uvm_pglistfree(rlist);
return (error);
}