提交 aa0d1564 编写于 作者: A Alexey Dobriyan 提交者: Linus Torvalds

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: NAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/20200219185330.GA4933@avx2Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 0693ffeb
...@@ -1076,6 +1076,7 @@ static int load_elf_binary(struct linux_binprm *bprm) ...@@ -1076,6 +1076,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
fput(interpreter); fput(interpreter);
kfree(interp_elf_ex); kfree(interp_elf_ex);
kfree(interp_elf_phdata);
} else { } else {
elf_entry = e_entry; elf_entry = e_entry;
if (BAD_ADDR(elf_entry)) { if (BAD_ADDR(elf_entry)) {
...@@ -1084,7 +1085,6 @@ static int load_elf_binary(struct linux_binprm *bprm) ...@@ -1084,7 +1085,6 @@ static int load_elf_binary(struct linux_binprm *bprm)
} }
} }
kfree(interp_elf_phdata);
kfree(elf_phdata); kfree(elf_phdata);
set_binfmt(&elf_format); set_binfmt(&elf_format);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册