Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [PV-on-HVM] Fix gnttab_map to not run off

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [PV-on-HVM] Fix gnttab_map to not run off the bottom of the gnttab space.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 26 Feb 2007 03:50:11 -0800
Delivery-date: Mon, 26 Feb 2007 04:20:51 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
# Date 1172249802 0
# Node ID 77298360e365b325f533489d83ba7f311b672b3e
# Parent  6253b8d32eb99b32b22c0d8075759569dc45d5da
[PV-on-HVM] Fix gnttab_map to not run off the bottom of the gnttab space.

Cleanup a few warnings: reached end of void function and unused variables.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/core/gnttab.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff -r 6253b8d32eb9 -r 77298360e365 
linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c    Fri Feb 23 16:36:55 
2007 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c    Fri Feb 23 16:56:42 
2007 +0000
@@ -518,25 +518,26 @@ static int gnttab_map(unsigned int start
 static int gnttab_map(unsigned int start_idx, unsigned int end_idx)
 {
        struct xen_add_to_physmap xatp;
-       unsigned int i;
+       unsigned int i = end_idx;
 
        /* Loop backwards, so that the first hypercall has the largest index,
         * ensuring that the table will grow only once.
         */
-       for (i = end_idx; i >= start_idx; i--) {
+       do {
                xatp.domid = DOMID_SELF;
                xatp.idx = i;
                xatp.space = XENMAPSPACE_grant_table;
                xatp.gpfn = (resume_frames >> PAGE_SHIFT) + i;
                if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))
                        BUG();
-       }
+       } while (i-- > start_idx);
+
+       return 0;
 }
 
 int gnttab_resume(void)
 {
-       struct xen_add_to_physmap xatp;
-       unsigned int i, max_nr_gframes, nr_gframes;
+       unsigned int max_nr_gframes, nr_gframes;
 
        nr_gframes = nr_grant_frames;
        max_nr_gframes = max_nr_grant_frames();

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [PV-on-HVM] Fix gnttab_map to not run off the bottom of the gnttab space., Xen patchbot-unstable <=