[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/20] ppc: Fix return value in cpu_post_load() error path
From: |
David Gibson |
Subject: |
[PULL 04/20] ppc: Fix return value in cpu_post_load() error path |
Date: |
Fri, 9 Oct 2020 21:19:35 +1100 |
From: Greg Kurz <groug@kaod.org>
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>
---
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;
}
}
--
2.26.2
- [PULL 00/20] ppc-for-5.2 queue 20201009, David Gibson, 2020/10/09
- [PULL 01/20] spapr: Handle HPT allocation failure in nested guest, David Gibson, 2020/10/09
- [PULL 04/20] ppc: Fix return value in cpu_post_load() error path,
David Gibson <=
- [PULL 03/20] ppc: Add a return value to ppc_set_compat() and ppc_set_compat_all(), David Gibson, 2020/10/09
- [PULL 02/20] spapr: Fix error leak in spapr_realize_vcpu(), David Gibson, 2020/10/09
- [PULL 05/20] spapr: Simplify error handling in callers of ppc_set_compat(), David Gibson, 2020/10/09
- [PULL 06/20] spapr: Get rid of cas_check_pvr() error reporting, David Gibson, 2020/10/09
- [PULL 08/20] spapr: Simplify error handling in spapr_vio_busdev_realize(), David Gibson, 2020/10/09
- [PULL 10/20] spapr: Simplify error handling in prop_get_fdt(), David Gibson, 2020/10/09
- [PULL 20/20] specs/ppc-spapr-numa: update with new NUMA support, David Gibson, 2020/10/09
- [PULL 18/20] spapr_numa: change reference-points and maxdomain settings, David Gibson, 2020/10/09
- [PULL 07/20] spapr: Simplify error handling in do_client_architecture_support(), David Gibson, 2020/10/09
- [PULL 09/20] spapr: Add a return value to spapr_drc_attach(), David Gibson, 2020/10/09