sched: enforce ref-counting on current task/thread pointers
This commit is contained in:
+6
-6
@@ -496,11 +496,7 @@ kern_status_t pmap_handle_fault(
|
||||
{
|
||||
// log_fault(fault_addr, flags);
|
||||
|
||||
if (flags & PMAP_FAULT_PRESENT) {
|
||||
return KERN_FATAL_ERROR;
|
||||
}
|
||||
|
||||
struct task *task = current_task();
|
||||
struct task *task = get_current_task();
|
||||
if (!task) {
|
||||
return KERN_FATAL_ERROR;
|
||||
}
|
||||
@@ -511,7 +507,11 @@ kern_status_t pmap_handle_fault(
|
||||
}
|
||||
|
||||
/* this must be called with `space` unlocked. */
|
||||
return address_space_demand_map(space, fault_addr, flags);
|
||||
kern_status_t status
|
||||
= address_space_demand_map(space, fault_addr, flags);
|
||||
|
||||
put_current_task(task);
|
||||
return status;
|
||||
}
|
||||
|
||||
kern_status_t pmap_add(
|
||||
|
||||
Reference in New Issue
Block a user