summaryrefslogtreecommitdiff
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2019-05-14 15:43:36 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-14 19:52:49 -0700
commit5cf4a36382588e601454f2f1dba91a78d385e2c3 (patch)
tree5471c415a5acbe07e34f683cc70d137743f0c5bf /fs/binfmt_elf.c
parent22f084dbc1617fb04f56185063aca9006d75005b (diff)
fs/binfmt_elf.c: make scope of "pos" variable smaller
Link: http://lkml.kernel.org/r/20190314204707.GC18143@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> 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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 6fa62f95f48e..ce276a46fa12 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -704,7 +704,6 @@ static int load_elf_binary(struct linux_binprm *bprm)
struct elfhdr interp_elf_ex;
} *loc;
struct arch_elf_state arch_state = INIT_ARCH_ELF_STATE;
- loff_t pos;
loc = kmalloc(sizeof(*loc), GFP_KERNEL);
if (!loc) {
@@ -744,6 +743,8 @@ static int load_elf_binary(struct linux_binprm *bprm)
for (i = 0; i < loc->elf_ex.e_phnum; i++) {
if (elf_ppnt->p_type == PT_INTERP) {
+ loff_t pos;
+
/* This is the program interpreter used for
* shared libraries - for now assume that this
* is an a.out format binary