diff --git a/kernel/arch/i386/arch_system.c b/kernel/arch/i386/arch_system.c index 4b1812be8..376586cd6 100644 --- a/kernel/arch/i386/arch_system.c +++ b/kernel/arch/i386/arch_system.c @@ -564,8 +564,6 @@ void restore_user_context(struct proc *p) #define TYPES 10 static int restores[TYPES], n = 0; - p->p_seg.p_kern_trap_style = KTS_NONE; - if(trap_style >= 0 && trap_style < TYPES) restores[trap_style]++; @@ -578,6 +576,8 @@ void restore_user_context(struct proc *p) } #endif + p->p_seg.p_kern_trap_style = KTS_NONE; + if(trap_style == KTS_SYSENTER) { restore_user_context_sysenter(p); NOT_REACHABLE;