From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAXFa-0003EO-1R for qemu-devel@nongnu.org; Mon, 03 Feb 2014 23:04:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAXFQ-0006e5-Es for qemu-devel@nongnu.org; Mon, 03 Feb 2014 23:04:41 -0500 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:38351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAXFP-0006cY-MO for qemu-devel@nongnu.org; Mon, 03 Feb 2014 23:04:32 -0500 Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 4 Feb 2014 14:04:26 +1000 From: Alexey Kardashevskiy Date: Tue, 4 Feb 2014 15:04:17 +1100 Message-Id: <1391486659-6584-3-git-send-email-aik@ozlabs.ru> In-Reply-To: <1391486659-6584-1-git-send-email-aik@ozlabs.ru> References: <1391486659-6584-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH v3 2/4] moxie: fix load_elf() usage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , green@moxielogic.com, qemu-ppc@nongnu.org, Alexander Graf At the moment in the case of error, load_elf() returns -1 so load_kernel() will not signal error at all. Cc: green@moxielogic.com Signed-off-by: Alexey Kardashevskiy --- hw/moxie/moxiesim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/moxie/moxiesim.c b/hw/moxie/moxiesim.c index ef4f3a8..a87ca6d 100644 --- a/hw/moxie/moxiesim.c +++ b/hw/moxie/moxiesim.c @@ -55,7 +55,7 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *loader_params) &entry, &kernel_low, &kernel_high, 1, ELF_MACHINE, 0); - if (!kernel_size) { + if (kernel_size <= 0) { fprintf(stderr, "qemu: could not load kernel '%s'\n", loader_params->kernel_filename); exit(1); -- 1.8.4.rc4