[IA64,PPC] Fix xencomm_add_offset(). index must be incremented.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 10 Nov 2006 15:27:22 +0000 (15:27 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 10 Nov 2006 15:27:22 +0000 (15:27 +0000)
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xen/arch/ia64/xen/xencomm.c
xen/arch/powerpc/usercopy.c

index 6ef781b0eac5748e5f7ee27c8b8d23eedf53e12e..8f6cec8cb763ad24ba7fbd7b1a2d40ddba1ff762 100644 (file)
@@ -345,6 +345,11 @@ xencomm_add_offset(
         unsigned int chunksz;
         unsigned int chunk_skip;
 
+        if (dest_paddr == XENCOMM_INVALID) {
+            i++;
+            continue;
+        }
+
         pgoffset = dest_paddr % PAGE_SIZE;
         chunksz = PAGE_SIZE - pgoffset;
 
@@ -356,6 +361,8 @@ xencomm_add_offset(
             desc->address[i] += chunk_skip;
         }
         bytes -= chunk_skip;
+       
+       i++;
     }
     return handle;
 }
index 48ab7579dee37a59b8a46bfb8ef00101eb3e5afe..d653ed1a05702fc8c5d565d83a9ff9afff8722e0 100644 (file)
@@ -249,6 +249,11 @@ int xencomm_add_offset(void *handle, unsigned int bytes)
         unsigned int chunksz;
         unsigned int chunk_skip;
 
+        if (dest_paddr == XENCOMM_INVALID) {
+            i++;
+            continue;
+        }
+
         pgoffset = dest_paddr % PAGE_SIZE;
         chunksz = PAGE_SIZE - pgoffset;
 
@@ -260,6 +265,8 @@ int xencomm_add_offset(void *handle, unsigned int bytes)
             desc->address[i] += chunk_skip;
         }
         bytes -= chunk_skip;
+
+       i++;
     }
     return 0;
 }