[PATCH 1/2] kexec-tools/xen: Do not call xc_interface_close() if xc_interface_open() failed

Daniel Kiper daniel.kiper at oracle.com
Mon Dec 2 14:06:24 EST 2013


Do not call xc_interface_close() if xc_interface_open() failed.
xc_interface_close() crashes if it gets NULL as an argument.
Relevant fix for libxenctrl will be posted too but kexec-tools
should also behave properly.

Signed-off-by: Daniel Kiper <daniel.kiper at oracle.com>
---
 kexec/arch/i386/crashdump-x86.c    |    2 +-
 kexec/arch/i386/kexec-x86-common.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index 85f3a87..a3eb5ae 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -305,7 +305,7 @@ static int get_crash_memory_ranges_xen(struct memory_range **range,
 
 	if (!xc) {
 		fprintf(stderr, "%s: Failed to open Xen control interface\n", __func__);
-		goto err;
+		return -1;
 	}
 
 	rc = xc_get_machine_memory_map(xc, e820entries, CRASH_MAX_MEMORY_RANGES);
diff --git a/kexec/arch/i386/kexec-x86-common.c b/kexec/arch/i386/kexec-x86-common.c
index bf58f53..f55e2c2 100644
--- a/kexec/arch/i386/kexec-x86-common.c
+++ b/kexec/arch/i386/kexec-x86-common.c
@@ -176,7 +176,7 @@ static int get_memory_ranges_xen(struct memory_range **range, int *ranges)
 
 	if (!xc) {
 		fprintf(stderr, "%s: Failed to open Xen control interface\n", __func__);
-		goto err;
+		return -1;
 	}
 
 	rc = xc_get_machine_memory_map(xc, e820entries, MAX_MEMORY_RANGES);
-- 
1.7.10.4




More information about the kexec mailing list