summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-12-06 12:47:05 +0000
committerbde <bde@FreeBSD.org>1996-12-06 12:47:05 +0000
commitae8570b44a74bcabe1f1c76d96d5a056edbeebf8 (patch)
tree7a611f2e593f68f0c89e017a498bf868c6ceb426 /sys/kern
parent1d12f608ff8ea7a0c67c599b5b7def8706acb62b (diff)
downloadFreeBSD-src-ae8570b44a74bcabe1f1c76d96d5a056edbeebf8.zip
FreeBSD-src-ae8570b44a74bcabe1f1c76d96d5a056edbeebf8.tar.gz
Fixed a null pointer panic in ADDENTRY(). Unloading the lkm and joy
modules sort of works now. Their devswitch entries aren't cleaned up, so accessing them after they have been unloaded causes a panic in spec_open(). Submitted by: durian@plutotech.com (Mike Durian), IIRC
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_conf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 5f31d6c..dd18e04 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_conf.c,v 1.11 1996/08/19 19:22:25 julian Exp $
+ * $Id: kern_conf.c,v 1.12 1996/10/28 11:34:47 phk Exp $
*/
#include <sys/param.h>
@@ -150,7 +150,8 @@ int TTYPE##_add(dev_t *descrip, \
if (oldentry) { \
*oldentry = TTYPE[i]; \
} \
- newentry->d_maj = i; \
+ if (newentry) \
+ newentry->d_maj = i; \
/* replace with new */ \
TTYPE[i] = newentry; \
\
OpenPOWER on IntegriCloud