aboutsummaryrefslogtreecommitdiff
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorGravatar Alexey Dobriyan <adobriyan@gmail.com> 2020-04-06 20:11:32 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org> 2020-04-07 10:43:44 -0700
commitaa0d1564b10f9165f913229d4428bdeea4e0d945 (patch)
tree965710cda9ee46180b4a7b8d3e195eb4a67aad63 /fs/binfmt_elf.c
parentfs/binfmt_elf.c: allocate less for static executable (diff)
downloadlinux-aa0d1564b10f9165f913229d4428bdeea4e0d945.tar.gz
linux-aa0d1564b10f9165f913229d4428bdeea4e0d945.tar.bz2
linux-aa0d1564b10f9165f913229d4428bdeea4e0d945.zip
fs/binfmt_elf.c: don't free interpreter's ELF pheaders on common path
Static executables don't need to free NULL pointer. It doesn't matter really because static executable is not common scenario but do it anyway out of pedantry. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/r/20200219185330.GA4933@avx2 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r--fs/binfmt_elf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index a3a9429ef1d2..13f25e241ac4 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1076,6 +1076,7 @@ out_free_interp:
fput(interpreter);
kfree(interp_elf_ex);
+ kfree(interp_elf_phdata);
} else {
elf_entry = e_entry;
if (BAD_ADDR(elf_entry)) {
@@ -1084,7 +1085,6 @@ out_free_interp:
}
}
- kfree(interp_elf_phdata);
kfree(elf_phdata);
set_binfmt(&elf_format);