Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2dbe125 authored by Amerigo Wang's avatar Amerigo Wang Committed by Linus Torvalds
Browse files

elf: fix one check-after-use



Check before use it.

Signed-off-by: default avatarWANG Cong <amwang@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: David Howells <dhowells@redhat.com>
Acked-by: default avatarRoland McGrath <roland@redhat.com>
Acked-by: default avatarJames Morris <jmorris@namei.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2027bd9f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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.
	 */