LKML Archive on
 help / color / Atom feed
From: Alexey Dobriyan <>
Subject: [PATCH 3/3] ELF: don't free interpreter's ELF pheaders on common path
Date: Wed, 19 Feb 2020 21:53:30 +0300
Message-ID: <20200219185330.GA4933@avx2> (raw)
In-Reply-To: <20200219185012.GB4871@avx2>

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 <>

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

--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1075,6 +1075,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
+		kfree(interp_elf_phdata);
 	} else {
 		elf_entry = e_entry;
 		if (BAD_ADDR(elf_entry)) {
@@ -1083,7 +1084,6 @@ static int load_elf_binary(struct linux_binprm *bprm)
-	kfree(interp_elf_phdata);

      reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19 18:48 [PATCH 1/3] ELF: delete "loc" variable Alexey Dobriyan
2020-02-19 18:50 ` [PATCH 2/3] ELF: allocate less for static executable Alexey Dobriyan
2020-02-19 18:53   ` Alexey Dobriyan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200219185330.GA4933@avx2 \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git
	git clone --mirror lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone