From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH] xen/arm: Don't call init_domheap_page with an empty range Date: Tue, 12 Nov 2013 21:42:55 +0000 Message-ID: <1384292575-2094-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.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VgLjh-0003ds-6d for xen-devel@lists.xenproject.org; Tue, 12 Nov 2013 21:43:02 +0000 Received: by mail-we0-f169.google.com with SMTP id q58so6705053wes.14 for ; Tue, 12 Nov 2013 13:42:59 -0800 (PST) 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@eu.citrix.com, tim@xen.org, ian.campbell@citrix.com, Julien Grall , patches@linaro.org List-Id: xen-devel@lists.xenproject.org When an initrd is given to xen by U-boot, it will reserve the memory in the device tree. In this case, when xen decides to free unused memory, dt_unreserved_regions will call init_domheap_page with the start and the end of range equals. But the latter assumes that (start > end), if not Xen will hang because the number of pages is equals to (unsigned)-1. Signed-off-by: Julien Grall --- xen/arch/arm/setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 1081b43..5794a03 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -173,7 +173,8 @@ static void dt_unreserved_regions(paddr_t s, paddr_t e, } } - cb(s, e); + if ( s != e ) + cb(s, e); } void __init discard_initial_modules(void) -- 1.8.3.1