diff options
author | jhb <jhb@FreeBSD.org> | 2017-05-11 03:37:05 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2017-05-11 03:37:05 +0000 |
commit | 05ee0a299c2447454ad71393e99dc5983598ae3a (patch) | |
tree | 266668128c994dc5901bee642fda10d6c61e7d24 /sys/vm | |
parent | b6a0863a469210c9e51df9e9a18f33460574ed4e (diff) | |
download | FreeBSD-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.c | 3 |
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; |