aboutsummaryrefslogtreecommitdiff
path: root/elf_ops.h
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2006-12-23 15:18:47 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2006-12-23 15:18:47 +0000
commit04d4b0c33f92e8431095af4c8ab1dc8098b70ae6 (patch)
treee5d6b0ddadb409836b9202d8263bea9461fbbebc /elf_ops.h
parent9042c0e20de166542b603621fd30dc8be95dfd4d (diff)
Simplify error handling again.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2275 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'elf_ops.h')
-rw-r--r--elf_ops.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/elf_ops.h b/elf_ops.h
index 1cd4f2b3d5..abcce093ef 100644
--- a/elf_ops.h
+++ b/elf_ops.h
@@ -167,7 +167,7 @@ int glue(load_elf, SZ)(int fd, int64_t virt_to_phys_addend,
if (!phdr)
goto fail;
if (read(fd, phdr, size) != size)
- goto fail1;
+ goto fail;
if (must_swab) {
for(i = 0; i < ehdr.e_phnum; i++) {
ph = &phdr[i];
@@ -184,9 +184,9 @@ int glue(load_elf, SZ)(int fd, int64_t virt_to_phys_addend,
data = qemu_mallocz(mem_size);
if (ph->p_filesz > 0) {
if (lseek(fd, ph->p_offset, SEEK_SET) < 0)
- goto fail2;
+ goto fail;
if (read(fd, data, ph->p_filesz) != ph->p_filesz)
- goto fail2;
+ goto fail;
}
addr = ph->p_vaddr + virt_to_phys_addend;
@@ -200,11 +200,8 @@ int glue(load_elf, SZ)(int fd, int64_t virt_to_phys_addend,
}
qemu_free(phdr);
return total_size;
-fail2:
+ fail:
qemu_free(data);
-fail1:
qemu_free(phdr);
-fail:
return -1;
}
-