elf{,_fdpic} coredump: get rid of pointless if (siginfo->si_signo)
we can't get to do_coredump() if that condition isn't satisfied... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
ec57941e03
commit
afabada957
2 changed files with 32 additions and 38 deletions
|
@ -1833,31 +1833,28 @@ static int fill_note_info(struct elfhdr *elf, int phdrs,
|
||||||
const siginfo_t *siginfo, struct pt_regs *regs)
|
const siginfo_t *siginfo, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
struct list_head *t;
|
struct list_head *t;
|
||||||
|
struct core_thread *ct;
|
||||||
|
struct elf_thread_status *ets;
|
||||||
|
|
||||||
if (!elf_note_info_init(info))
|
if (!elf_note_info_init(info))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (siginfo->si_signo) {
|
for (ct = current->mm->core_state->dumper.next;
|
||||||
struct core_thread *ct;
|
ct; ct = ct->next) {
|
||||||
struct elf_thread_status *ets;
|
ets = kzalloc(sizeof(*ets), GFP_KERNEL);
|
||||||
|
if (!ets)
|
||||||
|
return 0;
|
||||||
|
|
||||||
for (ct = current->mm->core_state->dumper.next;
|
ets->thread = ct->task;
|
||||||
ct; ct = ct->next) {
|
list_add(&ets->list, &info->thread_list);
|
||||||
ets = kzalloc(sizeof(*ets), GFP_KERNEL);
|
}
|
||||||
if (!ets)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ets->thread = ct->task;
|
list_for_each(t, &info->thread_list) {
|
||||||
list_add(&ets->list, &info->thread_list);
|
int sz;
|
||||||
}
|
|
||||||
|
|
||||||
list_for_each(t, &info->thread_list) {
|
ets = list_entry(t, struct elf_thread_status, list);
|
||||||
int sz;
|
sz = elf_dump_thread_status(siginfo->si_signo, ets);
|
||||||
|
info->thread_status_size += sz;
|
||||||
ets = list_entry(t, struct elf_thread_status, list);
|
|
||||||
sz = elf_dump_thread_status(siginfo->si_signo, ets);
|
|
||||||
info->thread_status_size += sz;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* now collect the dump for the current */
|
/* now collect the dump for the current */
|
||||||
memset(info->prstatus, 0, sizeof(*info->prstatus));
|
memset(info->prstatus, 0, sizeof(*info->prstatus));
|
||||||
|
|
|
@ -1561,6 +1561,8 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
|
||||||
struct elf_shdr *shdr4extnum = NULL;
|
struct elf_shdr *shdr4extnum = NULL;
|
||||||
Elf_Half e_phnum;
|
Elf_Half e_phnum;
|
||||||
elf_addr_t e_shoff;
|
elf_addr_t e_shoff;
|
||||||
|
struct core_thread *ct;
|
||||||
|
struct elf_thread_status *tmp;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We no longer stop all VM operations.
|
* We no longer stop all VM operations.
|
||||||
|
@ -1596,28 +1598,23 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (cprm->siginfo->si_signo) {
|
for (ct = current->mm->core_state->dumper.next;
|
||||||
struct core_thread *ct;
|
ct; ct = ct->next) {
|
||||||
|
tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
|
||||||
|
if (!tmp)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
tmp->thread = ct->task;
|
||||||
|
list_add(&tmp->list, &thread_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
list_for_each(t, &thread_list) {
|
||||||
struct elf_thread_status *tmp;
|
struct elf_thread_status *tmp;
|
||||||
|
int sz;
|
||||||
|
|
||||||
for (ct = current->mm->core_state->dumper.next;
|
tmp = list_entry(t, struct elf_thread_status, list);
|
||||||
ct; ct = ct->next) {
|
sz = elf_dump_thread_status(cprm->siginfo->si_signo, tmp);
|
||||||
tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
|
thread_status_size += sz;
|
||||||
if (!tmp)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
tmp->thread = ct->task;
|
|
||||||
list_add(&tmp->list, &thread_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
list_for_each(t, &thread_list) {
|
|
||||||
struct elf_thread_status *tmp;
|
|
||||||
int sz;
|
|
||||||
|
|
||||||
tmp = list_entry(t, struct elf_thread_status, list);
|
|
||||||
sz = elf_dump_thread_status(cprm->siginfo->si_signo, tmp);
|
|
||||||
thread_status_size += sz;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now collect the dump for the current */
|
/* now collect the dump for the current */
|
||||||
|
|
Loading…
Reference in a new issue