diff options
author | cperciva <cperciva@FreeBSD.org> | 2004-02-22 01:11:53 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2004-02-22 01:11:53 +0000 |
commit | 9f17986268a12a7b4a828eb338505725fdbcb954 (patch) | |
tree | 09b1ca67ab60a33e2e506286ddd0dfbdb90b8292 /sys/kern/uipc_usrreq.c | |
parent | f8fa6977f57df76fb0b2a68f902f288323e38041 (diff) | |
download | FreeBSD-src-9f17986268a12a7b4a828eb338505725fdbcb954.zip FreeBSD-src-9f17986268a12a7b4a828eb338505725fdbcb954.tar.gz |
If we're going to panic(), do it before dereferencing a NULL pointer.
Reported by: "Ted Unangst" <tedu@coverity.com>
Approved by: rwatson (mentor)
Diffstat (limited to 'sys/kern/uipc_usrreq.c')
-rw-r--r-- | sys/kern/uipc_usrreq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 1f9ca3d..f6a5ea2 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1095,9 +1095,9 @@ unp_init(void) { unp_zone = uma_zcreate("unpcb", sizeof(struct unpcb), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - uma_zone_set_max(unp_zone, nmbclusters); if (unp_zone == 0) panic("unp_init"); + uma_zone_set_max(unp_zone, nmbclusters); LIST_INIT(&unp_dhead); LIST_INIT(&unp_shead); } |