From 899134eb495fe784885cb495bb38e05639cca52a Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Mon, 14 Sep 2020 14:34:53 +0200 Subject: [PATCH] ppc: Fix return value in cpu_post_load() error path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VMState handlers are supposed to return negative errno values on failure. Signed-off-by: Greg Kurz Message-Id: <20200914123505.612812-4-groug@kaod.org> Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Gibson --- target/ppc/machine.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/ppc/machine.c b/target/ppc/machine.c index 109d071162..5e58377376 100644 --- a/target/ppc/machine.c +++ b/target/ppc/machine.c @@ -347,18 +347,19 @@ static int cpu_post_load(void *opaque, int version_id) if (cpu->compat_pvr) { uint32_t compat_pvr = cpu->compat_pvr; Error *local_err = NULL; + int ret; cpu->compat_pvr = 0; - ppc_set_compat(cpu, compat_pvr, &local_err); - if (local_err) { + ret = ppc_set_compat(cpu, compat_pvr, &local_err); + if (ret < 0) { error_report_err(local_err); - return -1; + return ret; } } else #endif { if (!pvr_match(cpu, env->spr[SPR_PVR])) { - return -1; + return -EINVAL; } }