Skip to content

Commit

Permalink
elf: fix one check-after-use
Browse files Browse the repository at this point in the history
Check before use it.

Signed-off-by: WANG Cong <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: David Howells <[email protected]>
Acked-by: Roland McGrath <[email protected]>
Acked-by: James Morris <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Amerigo Wang authored and torvalds committed Jul 1, 2009
1 parent 2027bd9 commit e2dbe12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/binfmt_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit e2dbe12

Please sign in to comment.