From e7ae771f6de2c7b3fa87823f87d6e10caeb91ec6 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 8 Mar 2015 19:30:01 +0100 Subject: Fix remaining warnings from Sparse (void return) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sparse report: hw/display/vga.c:2000:5: warning: returning void-valued expression hw/intc/arm_gic.c:707:9: warning: returning void-valued expression hw/intc/etraxfs_pic.c:138:9: warning: returning void-valued expression hw/nvram/fw_cfg.c:475:5: warning: returning void-valued expression hw/timer/a9gtimer.c:124:5: warning: returning void-valued expression hw/tpm/tpm_tis.c:794:5: warning: returning void-valued expression hw/usb/hcd-musb.c:558:9: warning: returning void-valued expression hw/usb/hcd-musb.c:776:13: warning: returning void-valued expression hw/usb/hcd-musb.c:867:5: warning: returning void-valued expression hw/usb/hcd-musb.c:932:5: warning: returning void-valued expression include/qom/cpu.h:584:5: warning: returning void-valued expression monitor.c:4686:13: warning: returning void-valued expression monitor.c:4690:13: warning: returning void-valued expression Cc: Edgar E. Iglesias Cc: Gerd Hoffmann Cc: Andreas Färber Cc: Luiz Capitulino Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- include/qom/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') 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 -- cgit v1.1 From 23bf2e76806390bf12798c2234a23c5c8a15c35d Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 14 Mar 2015 16:42:01 +0100 Subject: elf-loader: Add missing error handling for call of lseek This fixes a warning from Coverity. Signed-off-by: Stefan Weil Reviewed-by: Thomas Huth Signed-off-by: Michael Tokarev --- include/hw/elf_ops.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') 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; -- cgit v1.1