aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/hw/elf_ops.h4
-rw-r--r--include/qom/cpu.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h
index 16a627b..bd71968 100644
--- a/include/hw/elf_ops.h
+++ b/include/hw/elf_ops.h
@@ -315,7 +315,9 @@ static int glue(load_elf, SZ)(const char *name, int fd,
glue(load_symbols, SZ)(&ehdr, fd, must_swab, clear_lsb);
size = ehdr.e_phnum * sizeof(phdr[0]);
- lseek(fd, ehdr.e_phoff, SEEK_SET);
+ if (lseek(fd, ehdr.e_phoff, SEEK_SET) != ehdr.e_phoff) {
+ goto fail;
+ }
phdr = g_malloc0(size);
if (!phdr)
goto fail;
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index d6279c0..9dafb48 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -593,7 +593,7 @@ static inline void cpu_unaligned_access(CPUState *cpu, vaddr addr,
{
CPUClass *cc = CPU_GET_CLASS(cpu);
- return cc->do_unaligned_access(cpu, addr, is_write, is_user, retaddr);
+ cc->do_unaligned_access(cpu, addr, is_write, is_user, retaddr);
}
#endif