diff options
Diffstat (limited to 'arch/um/kernel/reboot.c')
| -rw-r--r-- | arch/um/kernel/reboot.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c index 4d93dff6b37..ced8903921a 100644 --- a/arch/um/kernel/reboot.c +++ b/arch/um/kernel/reboot.c @@ -3,11 +3,13 @@ * Licensed under the GPL */ -#include "linux/sched.h" -#include "linux/slab.h" -#include "kern_util.h" -#include "os.h" -#include "skas.h" +#include <linux/sched.h> +#include <linux/spinlock.h> +#include <linux/slab.h> +#include <linux/oom.h> +#include <kern_util.h> +#include <os.h> +#include <skas.h> void (*pm_power_off)(void); @@ -22,13 +24,18 @@ static void kill_off_processes(void) struct task_struct *p; int pid; + read_lock(&tasklist_lock); for_each_process(p) { - if (p->mm == NULL) - continue; + struct task_struct *t; - pid = p->mm->context.id.u.pid; + t = find_lock_task_mm(p); + if (!t) + continue; + pid = t->mm->context.id.u.pid; + task_unlock(t); os_kill_ptraced_process(pid, 1); } + read_unlock(&tasklist_lock); } } |
