[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.
This commit is contained in:
Leandro Lupori 2019-07-08 13:01:54 +00:00
parent 545151d107
commit 54fdf3bf19
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349833

View File

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