ia64/xen-unstable

changeset 13118:eb40e07b867f

[IA64] Fix calling xencomm_copy_chunk_{to, from} with len = 0

Originally debugged by Kazuhiro Suzuki

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild2.aw
date Thu Jan 04 16:10:25 2007 -0700 (2007-01-04)
parents 2d4807ed1056
children d9cc772c6bde
files xen/arch/ia64/xen/xencomm.c
line diff
     1.1 --- a/xen/arch/ia64/xen/xencomm.c	Thu Jan 04 16:00:56 2007 -0700
     1.2 +++ b/xen/arch/ia64/xen/xencomm.c	Thu Jan 04 16:10:25 2007 -0700
     1.3 @@ -153,7 +153,7 @@ xencomm_copy_from_guest(
     1.4          chunksz -= chunk_skip;
     1.5          skip -= chunk_skip;
     1.6  
     1.7 -        if (skip == 0) {
     1.8 +        if (skip == 0 && chunksz > 0) {
     1.9              unsigned int bytes = min(chunksz, n - to_pos);
    1.10  	    int res;
    1.11  
    1.12 @@ -295,7 +295,7 @@ xencomm_copy_to_guest(
    1.13          skip -= chunk_skip;
    1.14          dest_paddr += chunk_skip;
    1.15  
    1.16 -        if (skip == 0) {
    1.17 +        if (skip == 0 && chunksz > 0) {
    1.18              unsigned int bytes = min(chunksz, n - from_pos);
    1.19              int res;
    1.20