Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/net/npf Pull up following revision(s) (requested by r...
details: https://anonhg.NetBSD.org/src/rev/57dc7d03cd9d
branches: netbsd-7
changeset: 800098:57dc7d03cd9d
user: snj <snj%NetBSD.org@localhost>
date: Mon Dec 26 18:55:08 2016 +0000
description:
Pull up following revision(s) (requested by rmind in ticket #1339):
sys/net/npf/lpm.c: revision 1.2
Fix kmem_free() sizes in hashmap_rehash() and lpm_clear().
diffstat:
sys/net/npf/lpm.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (39 lines):
diff -r e6b5b96f2b09 -r 57dc7d03cd9d sys/net/npf/lpm.c
--- a/sys/net/npf/lpm.c Sat Dec 24 04:39:05 2016 +0000
+++ b/sys/net/npf/lpm.c Mon Dec 26 18:55:08 2016 +0000
@@ -31,7 +31,7 @@
#if defined(_KERNEL)
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lpm.c,v 1.1.2.2 2016/12/18 07:40:50 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lpm.c,v 1.1.2.3 2016/12/26 18:55:08 snj Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -117,7 +117,7 @@
entry = next;
}
}
- kmem_free(hmap->bucket, hmap->hashsize);
+ kmem_free(hmap->bucket, hmap->hashsize * sizeof(lpm_ent_t *));
hmap->bucket = NULL;
hmap->hashsize = 0;
hmap->nitems = 0;
@@ -158,7 +158,7 @@
for (hashsize = 1; hashsize < size; hashsize <<= 1) {
continue;
}
- bucket = kmem_zalloc(hashsize * sizeof(*bucket), KM_SLEEP);
+ bucket = kmem_zalloc(hashsize * sizeof(lpm_ent_t *), KM_SLEEP);
if (bucket == NULL)
return false;
for (unsigned n = 0; n < hmap->hashsize; n++) {
@@ -175,7 +175,7 @@
}
}
if (hmap->bucket)
- kmem_free(hmap->bucket, hmap->hashsize);
+ kmem_free(hmap->bucket, hmap->hashsize * sizeof(lpm_ent_t *));
hmap->bucket = bucket;
hmap->hashsize = hashsize;
return true;
Home |
Main Index |
Thread Index |
Old Index