From: Amerigo Wang Date: Wed, 1 Jul 2009 05:06:26 +0000 (-0400) Subject: elf: fix one check-after-use X-Git-Tag: v2.6.31-rc2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2dbe12557d85d81f4527879499f55681c3cca4f;p=profile%2Fivi%2Fkernel-x86-ivi.git elf: fix one check-after-use Check before use it. Signed-off-by: WANG Cong Cc: Alexander Viro Cc: David Howells Acked-by: Roland McGrath Acked-by: James Morris Signed-off-by: Linus Torvalds --- diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index f186790..b7c1603 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -1522,11 +1522,11 @@ static int fill_note_info(struct elfhdr *elf, int phdrs, 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. */