svn commit: r349833 - head/sys/powerpc/aim

Leandro Lupori luporl at FreeBSD.org
Mon Jul 8 13:01:55 UTC 2019


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);


More information about the svn-src-head mailing list