diff options
author | Renato Botelho <renato@netgate.com> | 2016-03-14 07:56:21 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-03-14 07:56:21 -0300 |
commit | a26e4b3de35515ec3eaf2eb76b001a6a502bf56c (patch) | |
tree | 66dd86f3e16db9b45f07c989e95501b6456cf6a5 /sys/kern/link_elf_obj.c | |
parent | 7d66bf7f17e48798ec04b7a6d99daff1820e28f8 (diff) | |
parent | a64e8d254dc9ecd38594b71dcd7d53c6084c5abc (diff) | |
download | FreeBSD-src-a26e4b3de35515ec3eaf2eb76b001a6a502bf56c.zip FreeBSD-src-a26e4b3de35515ec3eaf2eb76b001a6a502bf56c.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sys/kern/link_elf_obj.c')
-rw-r--r-- | sys/kern/link_elf_obj.c | 57 |
1 files changed, 19 insertions, 38 deletions
diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index dc13283..0aa1326 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -896,8 +896,7 @@ out: vn_close(nd.ni_vp, FREAD, td->td_ucred, td); if (error && lf) linker_file_unload(lf, LINKER_UNLOAD_FORCE); - if (hdr) - free(hdr, M_LINKER); + free(hdr, M_LINKER); return error; } @@ -928,18 +927,12 @@ link_elf_unload_file(linker_file_t file) } } if (ef->preloaded) { - if (ef->reltab) - free(ef->reltab, M_LINKER); - if (ef->relatab) - free(ef->relatab, M_LINKER); - if (ef->progtab) - free(ef->progtab, M_LINKER); - if (ef->ctftab) - free(ef->ctftab, M_LINKER); - if (ef->ctfoff) - free(ef->ctfoff, M_LINKER); - if (ef->typoff) - free(ef->typoff, M_LINKER); + free(ef->reltab, M_LINKER); + free(ef->relatab, M_LINKER); + free(ef->progtab, M_LINKER); + free(ef->ctftab, M_LINKER); + free(ef->ctfoff, M_LINKER); + free(ef->typoff, M_LINKER); if (file->filename != NULL) preload_delete_name(file->filename); /* XXX reclaim module memory? */ @@ -947,37 +940,25 @@ link_elf_unload_file(linker_file_t file) } for (i = 0; i < ef->nreltab; i++) - if (ef->reltab[i].rel) - free(ef->reltab[i].rel, M_LINKER); + free(ef->reltab[i].rel, M_LINKER); for (i = 0; i < ef->nrelatab; i++) - if (ef->relatab[i].rela) - free(ef->relatab[i].rela, M_LINKER); - if (ef->reltab) - free(ef->reltab, M_LINKER); - if (ef->relatab) - free(ef->relatab, M_LINKER); - if (ef->progtab) - free(ef->progtab, M_LINKER); + free(ef->relatab[i].rela, M_LINKER); + free(ef->reltab, M_LINKER); + free(ef->relatab, M_LINKER); + free(ef->progtab, M_LINKER); if (ef->object) { vm_map_remove(kernel_map, (vm_offset_t) ef->address, (vm_offset_t) ef->address + (ef->object->size << PAGE_SHIFT)); } - if (ef->e_shdr) - free(ef->e_shdr, M_LINKER); - if (ef->ddbsymtab) - free(ef->ddbsymtab, M_LINKER); - if (ef->ddbstrtab) - free(ef->ddbstrtab, M_LINKER); - if (ef->shstrtab) - free(ef->shstrtab, M_LINKER); - if (ef->ctftab) - free(ef->ctftab, M_LINKER); - if (ef->ctfoff) - free(ef->ctfoff, M_LINKER); - if (ef->typoff) - free(ef->typoff, M_LINKER); + free(ef->e_shdr, M_LINKER); + free(ef->ddbsymtab, M_LINKER); + free(ef->ddbstrtab, M_LINKER); + free(ef->shstrtab, M_LINKER); + free(ef->ctftab, M_LINKER); + free(ef->ctfoff, M_LINKER); + free(ef->typoff, M_LINKER); } static const char * |