Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Dec 2018 00:33:03 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r341668 - stable/12/sys/kern
Message-ID:  <201812070033.wB70X3JS078715@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Dec  7 00:33:02 2018
New Revision: 341668
URL: https://svnweb.freebsd.org/changeset/base/341668

Log:
  MFC r340862:
  Trivial reduction of the code duplication, reuse the return FALSE code.

Modified:
  stable/12/sys/kern/imgact_elf.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/imgact_elf.c
==============================================================================
--- stable/12/sys/kern/imgact_elf.c	Fri Dec  7 00:27:38 2018	(r341667)
+++ stable/12/sys/kern/imgact_elf.c	Fri Dec  7 00:33:02 2018	(r341668)
@@ -2363,8 +2363,7 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Bra
 		    curthread->td_ucred, NOCRED, NULL, curthread);
 		if (error != 0) {
 			uprintf("i/o error PT_NOTE\n");
-			res = FALSE;
-			goto ret;
+			goto retf;
 		}
 		note = note0 = (const Elf_Note *)buf;
 		note_end = (const Elf_Note *)(buf + pnote->p_filesz);
@@ -2378,8 +2377,7 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Bra
 	for (i = 0; i < 100 && note >= note0 && note < note_end; i++) {
 		if (!aligned(note, Elf32_Addr) || (const char *)note_end -
 		    (const char *)note < sizeof(Elf_Note)) {
-			res = FALSE;
-			goto ret;
+			goto retf;
 		}
 		if (note->n_namesz != checknote->hdr.n_namesz ||
 		    note->n_descsz != checknote->hdr.n_descsz ||
@@ -2407,6 +2405,7 @@ nextnote:
 		    roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE) +
 		    roundup2(note->n_descsz, ELF_NOTE_ROUNDSIZE));
 	}
+retf:
 	res = FALSE;
 ret:
 	free(buf, M_TEMP);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812070033.wB70X3JS078715>