aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2020-09-14 14:34:53 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2020-10-09 10:15:06 +1100
commit899134eb495fe784885cb495bb38e05639cca52a (patch)
tree6710c848861e77e3ffec0d51a9c3bebe935770c7 /target
parent2c82e8df4d6a99c024f3955fe6a6bf94ca59ab63 (diff)
downloadqemu-899134eb495fe784885cb495bb38e05639cca52a.zip
qemu-899134eb495fe784885cb495bb38e05639cca52a.tar.gz
qemu-899134eb495fe784885cb495bb38e05639cca52a.tar.bz2
ppc: Fix return value in cpu_post_load() error path
VMState handlers are supposed to return negative errno values on failure. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <20200914123505.612812-4-groug@kaod.org> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target')
-rw-r--r--target/ppc/machine.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/target/ppc/machine.c b/target/ppc/machine.c
index 109d071..5e58377 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;
}
}