xen/arm: next_module: Skip module if the size is 0
authorJulien Grall <julien.grall@linaro.org>
Mon, 17 Mar 2014 14:05:54 +0000 (14:05 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 21 Mar 2014 11:10:12 +0000 (11:10 +0000)
When the the module size is 0, it means that the module was not provided by
the user. It can happen, if the user choose to boot without initrd.

In this case, both fields (start and size) are zeroed. Therefore, next_module
will return 0 every time if there is other non-zero module after this one. This
can happen when the XSM module is added.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/setup.c

index d59e7f860b67c7664bf8e4e7a3dbfcbdd444d61a..215ec242cf8d440e3d055da30ac7a3bff3777cae 100644 (file)
@@ -284,6 +284,9 @@ static paddr_t __init next_module(paddr_t s, paddr_t *end)
         paddr_t mod_s = mi->module[i].start;
         paddr_t mod_e = mod_s + mi->module[i].size;
 
+        if ( !mi->module[i].size )
+            continue;
+
         if ( mod_s < s )
             continue;
         if ( mod_s > lowest )