Author: jhb
Date: Tue Apr  4 16:26:46 2017
New Revision: 316493
URL: https://svnweb.freebsd.org/changeset/base/316493

Log:
  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

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==============================================================================
--- head/sys/vm/uma_core.c      Tue Apr  4 16:08:51 2017        (r316492)
+++ head/sys/vm/uma_core.c      Tue Apr  4 16:26:46 2017        (r316493)
@@ -1888,6 +1888,9 @@ uma_zcreate(const char *name, size_t siz
        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;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to