Author: luporl
Date: Mon Jul  8 13:01:54 2019
New Revision: 349833
URL: https://svnweb.freebsd.org/changeset/base/349833

Log:
  [PPC] Add missing SLB allocation KASSERT
  
  Although PPC SLB code doesn't handle allocation failures,
  which are rare, in most places it asserts that the pointer
  returned by uma_zalloc() is not NULL, making it easier to
  identify the failure and avoiding an invalid pointer dereference.
  
  This change simply adds a missing KASSERT in SLB code.

Modified:
  head/sys/powerpc/aim/slb.c

Modified: head/sys/powerpc/aim/slb.c
==============================================================================
--- head/sys/powerpc/aim/slb.c  Mon Jul  8 10:21:38 2019        (r349832)
+++ head/sys/powerpc/aim/slb.c  Mon Jul  8 13:01:54 2019        (r349833)
@@ -416,6 +416,7 @@ slb_alloc_tree(void)
        struct slbtnode *root;
 
        root = uma_zalloc(slbt_zone, M_NOWAIT | M_ZERO);
+       KASSERT(root != NULL, ("unhandled NULL case"));
        root->ua_level = UAD_ROOT_LEVEL;
 
        return (root);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to