This check makes sure that we indeed get the memory information.

Signed-off-by: Zhang Yanfei <[email protected]>
---
 kexec/kexec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kexec/kexec.c b/kexec/kexec.c
index 89ec182..16c6308 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -675,7 +675,7 @@ static int my_load(const char *type, int fileind, int argc, 
char **argv,
 #endif
 
        if (get_memory_ranges(&info.memory_range, &info.memory_ranges,
-               info.kexec_flags) < 0) {
+               info.kexec_flags) < 0 || info.memory_ranges == 0) {
                fprintf(stderr, "Could not get memory layout\n");
                return -1;
        }
-- 
1.7.1

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to