xen: arm: correct off-by-one error in consider_modules
authorIan Campbell <ijc@hellion.org.uk>
Sun, 21 Dec 2014 11:18:53 +0000 (11:18 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 6 Jan 2015 11:12:19 +0000 (11:12 +0000)
By iterating up to <= mi->nr_mods we are running off the end of the boot
modules, but more importantly it causes us to then skip the first FDT reserved
region, meaning we might clobber it.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/setup.c

index 3991d64cc009671b429013b6d3d44910f28e9886..f49569d02b8c22b0374e215b6e2e067ebfdfd54b 100644 (file)
@@ -286,7 +286,7 @@ static paddr_t __init consider_modules(paddr_t s, paddr_t e,
         return 0;
 
     /* First check the boot modules */
-    for ( i = first_mod; i <= mi->nr_mods; i++ )
+    for ( i = first_mod; i < mi->nr_mods; i++ )
     {
         paddr_t mod_s = mi->module[i].start;
         paddr_t mod_e = mod_s + mi->module[i].size;