]> Zhao Yanbai Git Server - minix.git/commitdiff
kernel: fix assert condition after a caught in-kernel pagefault
authorBen Gras <ben@minix3.org>
Wed, 9 Jun 2010 10:59:57 +0000 (10:59 +0000)
committerBen Gras <ben@minix3.org>
Wed, 9 Jun 2010 10:59:57 +0000 (10:59 +0000)
kernel/arch/i386/memory.c

index ca93a298d5b8c8bd582152b26b40112e3d17cded..b465a8fa3505e2134869af4de713cbc86097201e 100644 (file)
@@ -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;
        }