linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch 1/3] elf: fix one check-after-use
@ 2009-07-01  5:06 Amerigo Wang
  2009-07-01  5:06 ` [Patch 2/3] elf: clean up fill_note_info() Amerigo Wang
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Amerigo Wang @ 2009-07-01  5:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Viro, Roland McGrath, Serge Hallyn, David Howells,
	Amerigo Wang, James Morris, linux-fsdevel, Andrew Morton


Check before use it.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: David Howells <dhowells@redhat.com>

---
Index: linux-2.6/fs/binfmt_elf.c
===================================================================
--- linux-2.6.orig/fs/binfmt_elf.c
+++ linux-2.6/fs/binfmt_elf.c
@@ -1522,11 +1522,11 @@ static int fill_note_info(struct elfhdr 
 	info->thread = NULL;
 
 	psinfo = kmalloc(sizeof(*psinfo), GFP_KERNEL);
-	fill_note(&info->psinfo, "CORE", NT_PRPSINFO, sizeof(*psinfo), psinfo);
-
 	if (psinfo == NULL)
 		return 0;
 
+	fill_note(&info->psinfo, "CORE", NT_PRPSINFO, sizeof(*psinfo), psinfo);
+
 	/*
 	 * Figure out how many notes we're going to need for each thread.
 	 */

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-07-02  9:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01  5:06 [Patch 1/3] elf: fix one check-after-use Amerigo Wang
2009-07-01  5:06 ` [Patch 2/3] elf: clean up fill_note_info() Amerigo Wang
2009-07-01 19:29   ` Andrew Morton
2009-07-02  9:40     ` Amerigo Wang
2009-07-01  5:06 ` [Patch 3/3] elf: use a macro instead of a raw number Amerigo Wang
2009-07-01  7:38   ` Roland McGrath
2009-07-02  9:38     ` Amerigo Wang
2009-07-02  9:55       ` Roland McGrath
2009-07-01  7:39 ` [Patch 1/3] elf: fix one check-after-use Roland McGrath
2009-07-01 15:13 ` James Morris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).