From b17dd2bcc02cf408a3c8b9dee1df0da90a4f5217 Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Sun, 22 Feb 2004 01:11:53 +0000 Subject: [PATCH] If we're going to panic(), do it before dereferencing a NULL pointer. Reported by: "Ted Unangst" Approved by: rwatson (mentor) --- sys/kern/uipc_usrreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 1f9ca3d2007..f6a5ea23e99 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); }