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>
This commit is contained in:
kfraser@localhost.localdomain committed 2007-01-12 14:51:27 +00:00
1 parent e04e1175e8
commit effd10be68
1 file changed
+2 -2
+2 -2
View File
@@ -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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.