Author: jhb
Date: Thu May 11 03:37:05 2017
New Revision: 318169
URL: https://svnweb.freebsd.org/changeset/base/318169

Log:
  MFC 316493: Assert that the align parameter to uma_zcreate() is valid.

Modified:
  stable/11/sys/vm/uma_core.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/vm/uma_core.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/vm/uma_core.c
==============================================================================
--- stable/11/sys/vm/uma_core.c Thu May 11 00:27:26 2017        (r318168)
+++ stable/11/sys/vm/uma_core.c Thu May 11 03:37:05 2017        (r318169)
@@ -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