diff options
-rw-r--r-- | fs/binfmt_elf_fdpic.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 71bcc4b4d088..1b59b1edf26d 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c | |||
@@ -1573,7 +1573,6 @@ static int elf_fdpic_core_dump(long signr, struct pt_regs *regs, | |||
1573 | struct memelfnote *notes = NULL; | 1573 | struct memelfnote *notes = NULL; |
1574 | struct elf_prstatus *prstatus = NULL; /* NT_PRSTATUS */ | 1574 | struct elf_prstatus *prstatus = NULL; /* NT_PRSTATUS */ |
1575 | struct elf_prpsinfo *psinfo = NULL; /* NT_PRPSINFO */ | 1575 | struct elf_prpsinfo *psinfo = NULL; /* NT_PRPSINFO */ |
1576 | struct task_struct *g, *p; | ||
1577 | LIST_HEAD(thread_list); | 1576 | LIST_HEAD(thread_list); |
1578 | struct list_head *t; | 1577 | struct list_head *t; |
1579 | elf_fpregset_t *fpu = NULL; | 1578 | elf_fpregset_t *fpu = NULL; |
@@ -1622,23 +1621,19 @@ static int elf_fdpic_core_dump(long signr, struct pt_regs *regs, | |||
1622 | #endif | 1621 | #endif |
1623 | 1622 | ||
1624 | if (signr) { | 1623 | if (signr) { |
1624 | struct core_thread *ct; | ||
1625 | struct elf_thread_status *tmp; | 1625 | struct elf_thread_status *tmp; |
1626 | rcu_read_lock(); | 1626 | |
1627 | do_each_thread(g,p) | 1627 | for (ct = current->mm->core_state->dumper.next; |
1628 | if (current->mm == p->mm && current != p) { | 1628 | ct; ct = ct->next) { |
1629 | if (p->flags & PF_KTHREAD) | 1629 | tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); |
1630 | continue; | 1630 | if (!tmp) |
1631 | 1631 | goto cleanup; | |
1632 | tmp = kzalloc(sizeof(*tmp), GFP_ATOMIC); | 1632 | |
1633 | if (!tmp) { | 1633 | tmp->thread = ct->task; |
1634 | rcu_read_unlock(); | 1634 | list_add(&tmp->list, &thread_list); |
1635 | goto cleanup; | 1635 | } |
1636 | } | 1636 | |
1637 | tmp->thread = p; | ||
1638 | list_add(&tmp->list, &thread_list); | ||
1639 | } | ||
1640 | while_each_thread(g,p); | ||
1641 | rcu_read_unlock(); | ||
1642 | list_for_each(t, &thread_list) { | 1637 | list_for_each(t, &thread_list) { |
1643 | struct elf_thread_status *tmp; | 1638 | struct elf_thread_status *tmp; |
1644 | int sz; | 1639 | int sz; |