Trivial reduction of the code duplication, reuse the return FALSE code.
Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
This commit is contained in:
parent
96fdfb3649
commit
eda8fe63c9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=340862
@ -2364,8 +2364,7 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Brandnote *checknote,
|
|||||||
curthread->td_ucred, NOCRED, NULL, curthread);
|
curthread->td_ucred, NOCRED, NULL, curthread);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
uprintf("i/o error PT_NOTE\n");
|
uprintf("i/o error PT_NOTE\n");
|
||||||
res = FALSE;
|
goto retf;
|
||||||
goto ret;
|
|
||||||
}
|
}
|
||||||
note = note0 = (const Elf_Note *)buf;
|
note = note0 = (const Elf_Note *)buf;
|
||||||
note_end = (const Elf_Note *)(buf + pnote->p_filesz);
|
note_end = (const Elf_Note *)(buf + pnote->p_filesz);
|
||||||
@ -2379,8 +2378,7 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Brandnote *checknote,
|
|||||||
for (i = 0; i < 100 && note >= note0 && note < note_end; i++) {
|
for (i = 0; i < 100 && note >= note0 && note < note_end; i++) {
|
||||||
if (!aligned(note, Elf32_Addr) || (const char *)note_end -
|
if (!aligned(note, Elf32_Addr) || (const char *)note_end -
|
||||||
(const char *)note < sizeof(Elf_Note)) {
|
(const char *)note < sizeof(Elf_Note)) {
|
||||||
res = FALSE;
|
goto retf;
|
||||||
goto ret;
|
|
||||||
}
|
}
|
||||||
if (note->n_namesz != checknote->hdr.n_namesz ||
|
if (note->n_namesz != checknote->hdr.n_namesz ||
|
||||||
note->n_descsz != checknote->hdr.n_descsz ||
|
note->n_descsz != checknote->hdr.n_descsz ||
|
||||||
@ -2408,6 +2406,7 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Brandnote *checknote,
|
|||||||
roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE) +
|
roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE) +
|
||||||
roundup2(note->n_descsz, ELF_NOTE_ROUNDSIZE));
|
roundup2(note->n_descsz, ELF_NOTE_ROUNDSIZE));
|
||||||
}
|
}
|
||||||
|
retf:
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
ret:
|
ret:
|
||||||
free(buf, M_TEMP);
|
free(buf, M_TEMP);
|
||||||
|
Loading…
Reference in New Issue
Block a user