From: Ben Gras Date: Wed, 9 Jun 2010 12:56:44 +0000 (+0000) Subject: assert conditions fix from trunk. X-Git-Tag: v3.1.7~1 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=cd445fe22a41ba770033d7a6c81caeda5291973e;p=minix.git assert conditions fix from trunk. --- diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index ca93a298d..b465a8fa3 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -832,7 +832,7 @@ int vmcheck; /* if nonzero, can return VMSUSPEND */ if((r=lin_lin_copy(procs[_SRC_], phys_addr[_SRC_], procs[_DST_], phys_addr[_DST_], bytes)) != OK) { - struct proc *target; + struct proc *target = NULL; phys_bytes lin; if(r != EFAULT_SRC && r != EFAULT_DST) panic("lin_lin_copy failed: %d", r); @@ -840,8 +840,6 @@ int vmcheck; /* if nonzero, can return VMSUSPEND */ return r; } - assert(procs[_SRC_] && procs[_DST_]); - if(r == EFAULT_SRC) { lin = phys_addr[_SRC_]; target = procs[_SRC_]; @@ -852,6 +850,9 @@ int vmcheck; /* if nonzero, can return VMSUSPEND */ panic("r strange: %d", r); } + assert(caller); + assert(target); + vm_suspend(caller, target, lin, bytes, VMSTYPE_KERNELCALL); return VMSUSPEND; }