diff options
Diffstat (limited to 'arch/um/kernel/reboot.c')
-rw-r--r-- | arch/um/kernel/reboot.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c index 4d93dff6b371..3d15243ce692 100644 --- a/arch/um/kernel/reboot.c +++ b/arch/um/kernel/reboot.c | |||
@@ -4,7 +4,9 @@ | |||
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include "linux/sched.h" | 6 | #include "linux/sched.h" |
7 | #include "linux/spinlock.h" | ||
7 | #include "linux/slab.h" | 8 | #include "linux/slab.h" |
9 | #include "linux/oom.h" | ||
8 | #include "kern_util.h" | 10 | #include "kern_util.h" |
9 | #include "os.h" | 11 | #include "os.h" |
10 | #include "skas.h" | 12 | #include "skas.h" |
@@ -22,13 +24,18 @@ static void kill_off_processes(void) | |||
22 | struct task_struct *p; | 24 | struct task_struct *p; |
23 | int pid; | 25 | int pid; |
24 | 26 | ||
27 | read_lock(&tasklist_lock); | ||
25 | for_each_process(p) { | 28 | for_each_process(p) { |
26 | if (p->mm == NULL) | 29 | struct task_struct *t; |
27 | continue; | ||
28 | 30 | ||
29 | pid = p->mm->context.id.u.pid; | 31 | t = find_lock_task_mm(p); |
32 | if (!t) | ||
33 | continue; | ||
34 | pid = t->mm->context.id.u.pid; | ||
35 | task_unlock(t); | ||
30 | os_kill_ptraced_process(pid, 1); | 36 | os_kill_ptraced_process(pid, 1); |
31 | } | 37 | } |
38 | read_unlock(&tasklist_lock); | ||
32 | } | 39 | } |
33 | } | 40 | } |
34 | 41 | ||