ia64/xen-unstable

changeset 13411:6a53d3abe7f8

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>
author kfraser@localhost.localdomain
date Fri Jan 12 14:51:27 2007 +0000 (2007-01-12)
parents f159e81e0b44
children dccc51cac027 1fc8fb8ea425
files xen/common/xencomm.c
line diff
     1.1 --- a/xen/common/xencomm.c	Fri Jan 12 14:50:01 2007 +0000
     1.2 +++ b/xen/common/xencomm.c	Fri Jan 12 14:51:27 2007 +0000
     1.3 @@ -119,7 +119,7 @@ xencomm_copy_from_guest(void *to, const 
     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 long src_maddr;
    1.10              unsigned long dest = (unsigned long)to + to_pos;
    1.11              unsigned int bytes = min(chunksz, n - to_pos);
    1.12 @@ -225,7 +225,7 @@ xencomm_copy_to_guest(void *to, const vo
    1.13          chunksz -= chunk_skip;
    1.14          skip -= chunk_skip;
    1.15  
    1.16 -        if (skip == 0) {
    1.17 +        if (skip == 0 && chunksz > 0) {
    1.18              unsigned long dest_maddr;
    1.19              unsigned long source = (unsigned long)from + from_pos;
    1.20              unsigned int bytes = min(chunksz, n - from_pos);