diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-08-14 16:01:08 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-08-14 16:01:08 +0100 |
commit | ad2c8b83e801340d21cca006d66879e90fc7ced6 (patch) | |
tree | d4575e6058cfdc90ed05b297e14f37aa767959e3 /xen/common/xencomm.c | |
parent | 5fcc2e769235528608c0f1edc0177a4eaccbf28e (diff) | |
download | xen-ad2c8b83e801340d21cca006d66879e90fc7ced6.tar.gz xen-ad2c8b83e801340d21cca006d66879e90fc7ced6.tar.bz2 xen-ad2c8b83e801340d21cca006d66879e90fc7ced6.zip |
[xen, xencomm] xencomm trivial bug fix
- fix return address of xencomm_copy_to_guest()
- fix xencomm_add_offset()
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Diffstat (limited to 'xen/common/xencomm.c')
-rw-r--r-- | xen/common/xencomm.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/xen/common/xencomm.c b/xen/common/xencomm.c index 8b7e502869..3ee5d00c25 100644 --- a/xen/common/xencomm.c +++ b/xen/common/xencomm.c @@ -232,7 +232,7 @@ xencomm_copy_to_guest(void *to, const void *from, unsigned int n, dest_maddr = paddr_to_maddr(dest_paddr + chunk_skip); if (dest_maddr == 0) - return -1; + return n - from_pos; if (xencomm_debug) printk("%lx[%d] -> %lx\n", source, bytes, dest_maddr); @@ -280,6 +280,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; @@ -291,6 +296,8 @@ int xencomm_add_offset(void **handle, unsigned int bytes) desc->address[i] += chunk_skip; } bytes -= chunk_skip; + + i++; } return 0; } |