diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-12 14:51:27 +0000 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-12 14:51:27 +0000 |
commit | effd10be68d89702eb60070f8e1bb9b0eded0c07 (patch) | |
tree | 7b3d6556cd13b1c9a120a95c01884f36addd3480 /xen/common/xencomm.c | |
parent | e04e1175e896d45aca60522d89149c51fe947c5f (diff) | |
download | xen-effd10be68d89702eb60070f8e1bb9b0eded0c07.tar.gz xen-effd10be68d89702eb60070f8e1bb9b0eded0c07.tar.bz2 xen-effd10be68d89702eb60070f8e1bb9b0eded0c07.zip |
Fix xencomm_copy_{from, to}_guest.
It should not call paddr_to_maddr() with invalid address.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Diffstat (limited to 'xen/common/xencomm.c')
-rw-r--r-- | xen/common/xencomm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/common/xencomm.c b/xen/common/xencomm.c index f33c753934..8b7e502869 100644 --- a/xen/common/xencomm.c +++ b/xen/common/xencomm.c @@ -119,7 +119,7 @@ xencomm_copy_from_guest(void *to, const void *from, unsigned int n, chunksz -= chunk_skip; skip -= chunk_skip; - if (skip == 0) { + if (skip == 0 && chunksz > 0) { unsigned long src_maddr; unsigned long dest = (unsigned long)to + to_pos; unsigned int bytes = min(chunksz, n - to_pos); @@ -225,7 +225,7 @@ xencomm_copy_to_guest(void *to, const void *from, unsigned int n, chunksz -= chunk_skip; skip -= chunk_skip; - if (skip == 0) { + if (skip == 0 && chunksz > 0) { unsigned long dest_maddr; unsigned long source = (unsigned long)from + from_pos; unsigned int bytes = min(chunksz, n - from_pos); |