lkml.org 
[lkml]   [2019]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] elf: make scope of "pos" variable smaller
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

fs/binfmt_elf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -703,7 +703,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) {
@@ -743,6 +742,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
\
 
 \ /
  Last update: 2019-03-14 21:48    [W:0.030 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site