fs/binfmt_elf.c: make scope of "pos" variable smaller
authorAlexey Dobriyan <adobriyan@gmail.com>
Tue, 14 May 2019 22:43:36 +0000 (15:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 May 2019 02:52:49 +0000 (19:52 -0700)
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>
fs/binfmt_elf.c

index 6fa62f95f48e068899df68527708df4603e703d5..ce276a46fa123a911166abb63f9b1881bda4fe4e 100644 (file)
@@ -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