From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5qFP-0006us-KJ for qemu-devel@nongnu.org; Wed, 22 Jan 2014 00:21:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5qFC-0007WK-LL for qemu-devel@nongnu.org; Wed, 22 Jan 2014 00:21:07 -0500 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:59072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5qFB-0007QT-Mr for qemu-devel@nongnu.org; Wed, 22 Jan 2014 00:20:54 -0500 Received: from /spool/local by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 22 Jan 2014 15:20:48 +1000 From: Alexey Kardashevskiy Date: Wed, 22 Jan 2014 16:20:39 +1100 Message-Id: <1390368041-2184-3-git-send-email-aik@ozlabs.ru> In-Reply-To: <1390368041-2184-1-git-send-email-aik@ozlabs.ru> References: <1390368041-2184-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH 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 , Peter Maydell , 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. 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