summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2019-05-15 00:43:48 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-15 04:52:50 +0200
commit852643165aea0999bb862b36511c5b9f6b11449f (patch)
treed4c4d8e88264a57112104a3c0f7126fdb2b9c2a3 /fs/binfmt_elf.c
parentfs/binfmt_elf.c: save 1 indent level (diff)
downloadlinux-852643165aea0999bb862b36511c5b9f6b11449f.tar.xz
linux-852643165aea0999bb862b36511c5b9f6b11449f.zip
fs//binfmt_elf.c: move variables initialization closer to their usage
Link: http://lkml.kernel.org/r/20190416202002.GB24304@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r--fs/binfmt_elf.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 3f18a7f9d49e..512646da8255 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -732,14 +732,6 @@ static int load_elf_binary(struct linux_binprm *bprm)
goto out;
elf_ppnt = elf_phdata;
- elf_bss = 0;
- elf_brk = 0;
-
- start_code = ~0UL;
- end_code = 0;
- start_data = 0;
- end_data = 0;
-
for (i = 0; i < loc->elf_ex.e_phnum; i++, elf_ppnt++) {
char *elf_interpreter;
loff_t pos;
@@ -887,6 +879,14 @@ out_free_interp:
if (retval < 0)
goto out_free_dentry;
+ elf_bss = 0;
+ elf_brk = 0;
+
+ start_code = ~0UL;
+ end_code = 0;
+ start_data = 0;
+ end_data = 0;
+
/* Now we do a little grungy work by mmapping the ELF image into
the correct location in memory. */
for(i = 0, elf_ppnt = elf_phdata;