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:
parent
5dc41cb0f2
commit
a5a355788e
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user