[IA64] Fix calling xencomm_copy_chunk_{to, from} with len = 0
authorawilliam@xenbuild2.aw <awilliam@xenbuild2.aw>
Thu, 4 Jan 2007 23:10:25 +0000 (16:10 -0700)
committerawilliam@xenbuild2.aw <awilliam@xenbuild2.aw>
Thu, 4 Jan 2007 23:10:25 +0000 (16:10 -0700)
Originally debugged by Kazuhiro Suzuki

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xen/arch/ia64/xen/xencomm.c

index 3b8e40b5b3e941c2ad98dbc36690fd6d80438bbc..21eef3a51a591ed7e2d0172fa773ea06773c4b40 100644 (file)
@@ -153,7 +153,7 @@ xencomm_copy_from_guest(
         chunksz -= chunk_skip;
         skip -= chunk_skip;
 
-        if (skip == 0) {
+        if (skip == 0 && chunksz > 0) {
             unsigned int bytes = min(chunksz, n - to_pos);
            int res;
 
@@ -295,7 +295,7 @@ xencomm_copy_to_guest(
         skip -= chunk_skip;
         dest_paddr += chunk_skip;
 
-        if (skip == 0) {
+        if (skip == 0 && chunksz > 0) {
             unsigned int bytes = min(chunksz, n - from_pos);
             int res;