[PATCH] fix valid_memory_range region merging

Michael Neuling mikey at neuling.org
Thu Apr 26 02:50:34 EDT 2007


Check the next region we are including is type RANGE_RAM as well.

Signed-off-by: Michael Neuling <mikey at neuling.org>
---
I've not actually seen this cause a problem, but it looks wrong.  We
should probably merge regions properly and solve this problem for real. 

 kexec/kexec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: kexec-tools-testing/kexec/kexec.c
===================================================================
--- kexec-tools-testing.orig/kexec/kexec.c
+++ kexec-tools-testing/kexec/kexec.c
@@ -96,7 +96,8 @@ int valid_memory_range(struct kexec_info
 		mstart = info->memory_range[i].start;
 		mend = info->memory_range[i].end;
 		if (i < info->memory_ranges - 1
-		    && mend == info->memory_range[i+1].start)
+		    && mend == info->memory_range[i+1].start
+		    && info->memory_range[i+1].type == RANGE_RAM)
 			mend = info->memory_range[i+1].end;
 
 		/* Check to see if we are fully contained */



More information about the kexec mailing list