summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorAmerigo Wang2009-07-01 07:06:26 +0200
committerLinus Torvalds2009-07-01 20:14:28 +0200
commite2dbe12557d85d81f4527879499f55681c3cca4f (patch)
treeced6a9800ecd9ee06a5c84fbdbb313e8ee1f44d1 /fs/binfmt_elf.c
parentMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block (diff)
downloadkernel-qcow2-linux-e2dbe12557d85d81f4527879499f55681c3cca4f.tar.gz
kernel-qcow2-linux-e2dbe12557d85d81f4527879499f55681c3cca4f.tar.xz
kernel-qcow2-linux-e2dbe12557d85d81f4527879499f55681c3cca4f.zip
elf: fix one check-after-use
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> Acked-by: Roland McGrath <roland@redhat.com> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r--fs/binfmt_elf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index f1867900e459..b7c1603cd4bd 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.
*/