summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2017-05-11 03:37:05 +0000
committerjhb <jhb@FreeBSD.org>2017-05-11 03:37:05 +0000
commit05ee0a299c2447454ad71393e99dc5983598ae3a (patch)
tree266668128c994dc5901bee642fda10d6c61e7d24 /sys/vm
parentb6a0863a469210c9e51df9e9a18f33460574ed4e (diff)
downloadFreeBSD-src-05ee0a299c2447454ad71393e99dc5983598ae3a.zip
FreeBSD-src-05ee0a299c2447454ad71393e99dc5983598ae3a.tar.gz
MFC 316493: Assert that the align parameter to uma_zcreate() is valid.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/uma_core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 08a40ac..26439dc 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -1888,6 +1888,9 @@ uma_zcreate(const char *name, size_t size, uma_ctor ctor, uma_dtor dtor,
uma_zone_t res;
bool locked;
+ KASSERT(powerof2(align + 1), ("invalid zone alignment %d for \"%s\"",
+ align, name));
+
/* This stuff is essential for the zone ctor */
memset(&args, 0, sizeof(args));
args.name = name;
OpenPOWER on IntegriCloud