summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2022-09-05 06:39:23 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2022-10-24 00:06:56 +0200
commit922ef161b21e605bf803f65dc928fabefb735702 (patch)
tree240728ec68a1c1da42d7972cfd5f19604cf4fbcf /fs/binfmt_elf.c
parentkill extern of vsyscall32_sysctl (diff)
downloadlinux-922ef161b21e605bf803f65dc928fabefb735702.tar.xz
linux-922ef161b21e605bf803f65dc928fabefb735702.zip
[elf][regset] clean fill_note_info() a bit
*info is already initialized... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r--fs/binfmt_elf.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 002fd713ac11..4190dafd2ec4 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -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;