mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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:
1 parent
e04e1175e8
commit
effd10be68
1 file changed
+2
-2
@@ -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);
|
||||
|
||||