From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH 18/21] xen: change the limit of nr_extents to UINT_MAX >> MEMOP_EXTENT_SHIFT Date: Fri, 5 Oct 2012 10:38:24 +0000 Message-ID: <1349433507-21148-18-git-send-email-ian.campbell@citrix.com> References: <1349433418.20946.46.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1349433418.20946.46.camel@zakaz.uk.xensource.com> 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.xen.org Cc: keir@xen.org, Stefano Stabellini , tim@xen.org, JBeulich@suse.com, stefano.stabelini@citrix.com List-Id: xen-devel@lists.xenproject.org From: Stefano Stabellini Currently do_memory_op has a different maximum limit for nr_extents on 32 bit and 64 bit. Change the limit to UINT_MAX >> MEMOP_EXTENT_SHIFT, so that it is the same in both cases. Signed-off-by: Stefano Stabellini Cc: keir@xen.org Cc: JBeulich@suse.com --- xen/common/memory.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/xen/common/memory.c b/xen/common/memory.c index 5bcb035..401d06c 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -540,7 +540,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE(void) arg) return start_extent; /* Is size too large for us to encode a continuation? */ - if ( reservation.nr_extents > (ULONG_MAX >> MEMOP_EXTENT_SHIFT) ) + if ( reservation.nr_extents > (UINT_MAX >> MEMOP_EXTENT_SHIFT) ) return start_extent; if ( unlikely(start_extent >= reservation.nr_extents) ) -- 1.7.9.1