summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/uvm/uvm_amap.c6
-rw-r--r--sys/uvm/uvm_aobj.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/uvm/uvm_amap.c b/sys/uvm/uvm_amap.c
index 098dc26d312..5cf15f24317 100644
--- a/sys/uvm/uvm_amap.c
+++ b/sys/uvm/uvm_amap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_amap.c,v 1.78 2016/10/08 16:19:44 stefan Exp $ */
+/* $OpenBSD: uvm_amap.c,v 1.79 2017/01/31 17:08:51 dhill Exp $ */
/* $NetBSD: uvm_amap.c,v 1.27 2000/11/25 06:27:59 chs Exp $ */
/*
@@ -368,7 +368,7 @@ amap_alloc1(int slots, int waitf, int lazyalloc)
return(amap);
fail1:
- free(amap->am_buckets, M_UVMAMAP, 0);
+ free(amap->am_buckets, M_UVMAMAP, buckets * sizeof(*amap->am_buckets));
TAILQ_FOREACH_SAFE(chunk, &amap->am_chunks, ac_list, tmp)
pool_put(&uvm_amap_chunk_pool, chunk);
pool_put(&uvm_amap_pool, amap);
@@ -414,7 +414,7 @@ amap_free(struct vm_amap *amap)
#ifdef UVM_AMAP_PPREF
if (amap->am_ppref && amap->am_ppref != PPREF_NONE)
- free(amap->am_ppref, M_UVMAMAP, 0);
+ free(amap->am_ppref, M_UVMAMAP, amap->am_nslot * sizeof(int));
#endif
if (UVM_AMAP_SMALL(amap))
diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c
index 8905157676b..63e6c993fc2 100644
--- a/sys/uvm/uvm_aobj.c
+++ b/sys/uvm/uvm_aobj.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_aobj.c,v 1.84 2016/09/24 18:40:29 tedu Exp $ */
+/* $OpenBSD: uvm_aobj.c,v 1.85 2017/01/31 17:08:51 dhill Exp $ */
/* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -403,7 +403,7 @@ uao_free(struct uvm_aobj *aobj)
uvmexp.swpgonly--;
}
}
- free(aobj->u_swslots, M_UVMAOBJ, 0);
+ free(aobj->u_swslots, M_UVMAOBJ, aobj->u_pages * sizeof(int));
}
/* finally free the aobj itself */
@@ -532,7 +532,7 @@ uao_shrink_array(struct uvm_object *uobj, int pages)
for (i = 0; i < pages; i++)
new_swslots[i] = aobj->u_swslots[i];
- free(aobj->u_swslots, M_UVMAOBJ, 0);
+ free(aobj->u_swslots, M_UVMAOBJ, aobj->u_pages * sizeof(int));
aobj->u_swslots = new_swslots;
aobj->u_pages = pages;
@@ -585,7 +585,7 @@ uao_grow_array(struct uvm_object *uobj, int pages)
for (i = 0; i < aobj->u_pages; i++)
new_swslots[i] = aobj->u_swslots[i];
- free(aobj->u_swslots, M_UVMAOBJ, 0);
+ free(aobj->u_swslots, M_UVMAOBJ, aobj->u_pages * sizeof(int));
aobj->u_swslots = new_swslots;
aobj->u_pages = pages;
@@ -664,7 +664,7 @@ uao_grow_convert(struct uvm_object *uobj, int pages)
}
}
- free(old_swslots, M_UVMAOBJ, 0);
+ free(old_swslots, M_UVMAOBJ, aobj->u_pages * sizeof(int));
aobj->u_pages = pages;
return 0;