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/10/sys/vm/uma_core.c
Directory Properties:
  stable/10/   (props changed)

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

Modified: stable/10/sys/vm/uma_core.c
==============================================================================
--- stable/10/sys/vm/uma_core.c Thu May 11 00:27:26 2017        (r318168)
+++ stable/10/sys/vm/uma_core.c Thu May 11 03:37:05 2017        (r318169)
@@ -1937,6 +1937,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;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "[email protected]"

Reply via email to