Date: Mon, 8 Jul 2019 13:01:54 +0000 (UTC) From: Leandro Lupori <luporl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349833 - head/sys/powerpc/aim Message-ID: <201907081301.x68D1sXT045005@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907081301.x68D1sXT045005>