Assert that the align parameter to uma_zcreate() is valid.

Reviewed by:	kib
MFC after:	1 week
Sponsored by:	DARPA / AFRL
Differential Revision:	https://reviews.freebsd.org/D10100
This commit is contained in:
John Baldwin 2017-04-04 16:26:46 +00:00
parent 5dc41cb0f2
commit a5a355788e

View File

@ -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;