From 3dc4924359f7f6ff9ee4bc7f70d29aace2df00b6 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Sat, 8 Nov 2003 12:08:12 +0000 Subject: [PATCH] In trap(), curlwp could be NULL so don't refer it implicitly. --- sys/arch/hppa/hppa/trap.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index 2debb8724f1d..e41b37156cb3 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.12 2003/10/31 03:28:13 simonb Exp $ */ +/* $NetBSD: trap.c,v 1.13 2003/11/08 12:08:12 tsutsui Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -69,7 +69,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.12 2003/10/31 03:28:13 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.13 2003/11/08 12:08:12 tsutsui Exp $"); /* #define INTRDEBUG */ /* #define TRAPDEBUG */ @@ -472,8 +472,8 @@ trap(type, frame) int type; struct trapframe *frame; { - struct lwp *l = curlwp; - struct proc *p = l->l_proc; + struct lwp *l; + struct proc *p; struct pcb *pcbp; vaddr_t va; struct vm_map *map; @@ -500,6 +500,10 @@ trap(type, frame) vftype = inst_store(opcode) ? VM_PROT_WRITE : VM_PROT_READ; } + if ((l = curlwp) == NULL) + l = &lwp0; + p = l->l_proc; + #ifdef DIAGNOSTIC /* * If we are on the emergency stack, then we either got