Skip to content

Commit

Permalink
[elf][regset] clean fill_note_info() a bit
Browse files Browse the repository at this point in the history
*info is already initialized...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 23, 2022
1 parent 87562ed commit 922ef16
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions fs/binfmt_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1833,24 +1833,17 @@ static int fill_note_info(struct elfhdr *elf, int phdrs,
struct elf_thread_core_info *t;
struct elf_prpsinfo *psinfo;
struct core_thread *ct;
unsigned int i;

info->size = 0;
info->thread = NULL;

psinfo = kmalloc(sizeof(*psinfo), GFP_KERNEL);
if (psinfo == NULL) {
info->psinfo.data = NULL; /* So we don't free this wrongly */
if (!psinfo)
return 0;
}

fill_note(&info->psinfo, "CORE", NT_PRPSINFO, sizeof(*psinfo), psinfo);

/*
* Figure out how many notes we're going to need for each thread.
*/
info->thread_notes = 0;
for (i = 0; i < view->n; ++i)
for (int i = 0; i < view->n; ++i)
if (view->regsets[i].core_note_type != 0)
++info->thread_notes;

Expand Down

0 comments on commit 922ef16

Please sign in to comment.