proc_destroy() refcnting issues dealt with
[akaros.git] / kern / arch / i686 / trap.c
index ce7a407..2b6aaca 100644 (file)
@@ -249,8 +249,9 @@ trap_dispatch(trapframe_t *tf)
                                panic("Damn Damn!  Unhandled trap in the kernel!");
                        else {
                                warn("Unexpected trap from userspace");
-                               kref_get(&current->kref, 1);
+                               proc_incref(current, 1);
                                proc_destroy(current);
+                               assert(0);
                                return;
                        }
        }
@@ -374,8 +375,9 @@ void page_fault_handler(struct trapframe *tf)
                       current->pid, prot & PROT_READ ? "READ" : "WRITE", fault_va,
                       tf->tf_eip, core_id(), err);
                print_trapframe(tf);
-               kref_get(&current->kref, 1);
+               proc_incref(current, 1);
                proc_destroy(current);
+               assert(0);
        }
 }