diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-01-18 15:17:39 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-01-18 15:17:39 +0000 |
commit | 78aea5f5171c0a157f68fa98f35967d2f5991fbc (patch) | |
tree | 899671ce60f99ff727862f242da8f535b8a713f8 /sys/arch/i386 | |
parent | ed4200c569a44220f2d23ed5f644d91b5f9b5995 (diff) |
Do not doubletrap when curproc->p_addr is zero, as it is during autoconfig.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/trap.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c index ce83d2eea25..f29f4aa7759 100644 --- a/sys/arch/i386/i386/trap.c +++ b/sys/arch/i386/i386/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.12 1996/10/17 13:36:45 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.13 1997/01/18 15:17:38 niklas Exp $ */ /* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */ #undef DEBUG @@ -227,11 +227,13 @@ trap(frame) case T_SEGNPFLT: case T_ALIGNFLT: /* Check for copyin/copyout fault. */ - pcb = &p->p_addr->u_pcb; - if (pcb->pcb_onfault != 0) { - copyfault: - frame.tf_eip = (int)pcb->pcb_onfault; - return; + if (p && p->p_addr) { + pcb = &p->p_addr->u_pcb; + if (pcb->pcb_onfault != 0) { + copyfault: + frame.tf_eip = (int)pcb->pcb_onfault; + return; + } } /* @@ -329,7 +331,7 @@ trap(frame) goto out; case T_PAGEFLT: /* allow page faults in kernel mode */ - if (p == 0) + if (p == 0 || p->p_addr == 0) goto we_re_toast; pcb = &p->p_addr->u_pcb; /* |