]> Zhao Yanbai Git Server - minix.git/commitdiff
VFS: fix "process already free" panic on reboot
authorDavid van Moolenbroek <david@minix3.org>
Wed, 2 May 2012 15:41:17 +0000 (17:41 +0200)
committerDavid van Moolenbroek <david@minix3.org>
Wed, 2 May 2012 15:42:50 +0000 (17:42 +0200)
Reported by Claudiu Dan Gheorghe, debugged by Thomas and myself

servers/vfs/misc.c

index 9cfed86afd83166f9f3b0b3192caa83db2b4f72d..d0ee9e898c444e82449de3e476197842a0bd214b 100644 (file)
@@ -359,12 +359,12 @@ void pm_reboot()
    */
   for (i = 0; i < NR_PROCS; i++) {
        rfp = &fproc[i];
-       if (rfp->fp_endpoint == NONE) continue;
 
        /* Don't just free the proc right away, but let it finish what it was
         * doing first */
        lock_proc(rfp, 0);
-       free_proc(rfp, 0);
+       if (rfp->fp_endpoint != NONE)
+               free_proc(rfp, 0);
        unlock_proc(rfp);
   }