From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: [PATCH v2 3/5] xen: change the limit of nr_extents to UINT_MAX >> MEMOP_EXTENT_SHIFT Date: Fri, 10 Aug 2012 13:10:10 +0100 Message-ID: <1344600612-10815-3-git-send-email-stefano.stabellini@eu.citrix.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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.xensource.com Cc: Tim.Deegan@citrix.com, Ian.Campbell@citrix.com, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org 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 --- 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 5d64cb6..7e58cc4 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -553,7 +553,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.2.5