Index: head/sys/kern/kern_conf.c =================================================================== --- head/sys/kern/kern_conf.c +++ head/sys/kern/kern_conf.c @@ -202,7 +202,8 @@ csw = NULL; } dev_unlock(); - *ref = 1; + if (csw != NULL) + *ref = 1; return (csw); }