[PATCH][resend] remove redundant NULL pointer checks in binfmt_elf*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Resend of a patch I send earlier (Wed, 23 Mar 2005 10:42:24 +0000) in a 
mail with subject "[PATCH] remove NULL checks before kfree in 
binfmt_elf_fdpic.c and binfmt_elf.c".

In a reply mail with Message-ID: <[email protected]> 
David Howells wrote :
>
> The FDPIC bit looks okay.
> 
> Acked-By: David Howells <[email protected]>


Would you mind merging this?


remove redundant NULL checks before kfree() in fs/binfmt_elf_fdpic.c and
fs/binfmt_elf.c

Signed-off-by: Jesper Juhl <[email protected]>
---

 fs/binfmt_elf.c       |    3 +--
 fs/binfmt_elf_fdpic.c |   15 +++++----------
 2 files changed, 6 insertions(+), 12 deletions(-)

--- linux-2.6.13-rc1-orig/fs/binfmt_elf_fdpic.c	2005-06-17 21:48:29.000000000 +0200
+++ linux-2.6.13-rc1/fs/binfmt_elf_fdpic.c	2005-07-01 00:37:21.000000000 +0200
@@ -418,16 +418,11 @@ error:
 		allow_write_access(interpreter);
 		fput(interpreter);
 	}
-	if (interpreter_name)
-		kfree(interpreter_name);
-	if (exec_params.phdrs)
-		kfree(exec_params.phdrs);
-	if (exec_params.loadmap)
-		kfree(exec_params.loadmap);
-	if (interp_params.phdrs)
-		kfree(interp_params.phdrs);
-	if (interp_params.loadmap)
-		kfree(interp_params.loadmap);
+	kfree(interpreter_name);
+	kfree(exec_params.phdrs);
+	kfree(exec_params.loadmap);
+	kfree(interp_params.phdrs);
+	kfree(interp_params.loadmap);
 	return retval;
 
 	/* unrecoverable error - kill the process */
--- linux-2.6.13-rc1-orig/fs/binfmt_elf.c	2005-06-29 21:45:00.000000000 +0200
+++ linux-2.6.13-rc1/fs/binfmt_elf.c	2005-07-01 00:37:21.000000000 +0200
@@ -1007,8 +1007,7 @@ out_free_dentry:
 	if (interpreter)
 		fput(interpreter);
 out_free_interp:
-	if (elf_interpreter)
-		kfree(elf_interpreter);
+	kfree(elf_interpreter);
 out_free_file:
 	sys_close(elf_exec_fileno);
 out_free_fh:



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux