[PATCH] remove NULL checks before kfree in binfmt_elf_fdpic.c and binfmt_elf.c

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

 



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


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

--- linux-2.6.12-rc1-mm1-orig/fs/binfmt_elf_fdpic.c	2005-03-21 23:15:43.000000000 +0100
+++ linux-2.6.12-rc1-mm1/fs/binfmt_elf_fdpic.c	2005-03-22 23:59:31.000000000 +0100
@@ -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.12-rc1-mm1-orig/fs/binfmt_elf.c	2005-03-21 23:15:43.000000000 +0100
+++ linux-2.6.12-rc1-mm1/fs/binfmt_elf.c	2005-03-23 00:02:11.000000000 +0100
@@ -1006,8 +1006,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]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux