From c4aeddc40b4f07e16ec4bdd0a3621c0927d403fa Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 5 Jun 2015 16:45:24 +0000 Subject: [PATCH] these days, curproc is never NULL, so skip those checks. Discussed with kettenis --- sys/arch/alpha/alpha/trap.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c index 675a226cfe4..3efaeba90f4 100644 --- a/sys/arch/alpha/alpha/trap.c +++ b/sys/arch/alpha/alpha/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.77 2014/12/24 21:15:30 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.78 2015/06/05 16:45:24 deraadt Exp $ */ /* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */ /*- @@ -418,13 +418,11 @@ do_fault: } va = trunc_page((vaddr_t)a0); - if (p != NULL) { - onfault = p->p_addr->u_pcb.pcb_onfault; - p->p_addr->u_pcb.pcb_onfault = 0; - } + onfault = p->p_addr->u_pcb.pcb_onfault; + p->p_addr->u_pcb.pcb_onfault = 0; rv = uvm_fault(map, va, 0, ftype); - if (p != NULL) - p->p_addr->u_pcb.pcb_onfault = onfault; + p->p_addr->u_pcb.pcb_onfault = onfault; + /* * If this was a stack access we keep track of the * maximum accessed stack size. Also, if vm_fault @@ -447,8 +445,7 @@ do_fault: if (!user) { /* Check for copyin/copyout fault */ - if (p != NULL && - p->p_addr->u_pcb.pcb_onfault != 0) { + if (p->p_addr->u_pcb.pcb_onfault != 0) { framep->tf_regs[FRAME_PC] = p->p_addr->u_pcb.pcb_onfault; p->p_addr->u_pcb.pcb_onfault = 0; -- 2.20.1