From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amerigo Wang Subject: [Patch 1/3] elf: fix one check-after-use Date: Wed, 1 Jul 2009 01:06:26 -0400 Message-ID: <20090701050840.6188.84560.sendpatchset@localhost.localdomain> Cc: Alexander Viro , Roland McGrath , Serge Hallyn , David Howells , Amerigo Wang , James Morris , linux-fsdevel@vger.kernel.org, Andrew Morton To: linux-kernel@vger.kernel.org Return-path: Received: from mx2.redhat.com ([66.187.237.31]:33405 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbZGAFHI (ORCPT ); Wed, 1 Jul 2009 01:07:08 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Check before use it. Signed-off-by: WANG Cong Cc: Alexander Viro Cc: David Howells --- 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. */