[PATCH 2/2] kexec: add additional check when getting memory info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Zhang Yanfei <zhangyanfei at cn.fujitsu.com>
---
 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



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux