From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [RFC 04/14] xen/arm: next_module: Skip module if the size is 0 Date: Wed, 12 Mar 2014 16:15:59 +0000 Message-ID: <1394640969-25583-5-git-send-email-julien.grall@linaro.org> References: <1394640969-25583-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WNlpR-0007E9-KX for xen-devel@lists.xenproject.org; Wed, 12 Mar 2014 16:16:25 +0000 Received: by mail-we0-f178.google.com with SMTP id u56so11608722wes.9 for ; Wed, 12 Mar 2014 09:16:24 -0700 (PDT) In-Reply-To: <1394640969-25583-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org 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. It will happend when the XSM module will be added. Signed-off-by: Julien Grall --- xen/arch/arm/setup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 959744e..31d853d 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -281,6 +281,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 ) -- 1.7.10.4