prison_racct_detach can be called for not fully initialized jail, so make it check that the jail has racct before doing anything

PR:		kern/174436
Reviewed by:	trasz
MFC after:	3 days
This commit is contained in:
mjg 2012-12-18 18:34:36 +00:00
parent 25561669c9
commit 5d2ad328b1

View File

@ -4518,6 +4518,8 @@ prison_racct_detach(struct prison *pr)
sx_assert(&allprison_lock, SA_UNLOCKED);
if (pr->pr_prison_racct == NULL)
return;
prison_racct_free(pr->pr_prison_racct);
pr->pr_prison_racct = NULL;
}