diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-06-20 13:38:22 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-06-20 13:38:22 +0100 |
commit | f423003436197a52b9a5af304af024bacd675f09 (patch) | |
tree | eb8c25c70a930af2e9988b96d39f211f7fdef2b3 /xen/common/compat | |
parent | 19636447b80747cd9da57cd540f09f475b13cfce (diff) | |
download | xen-f423003436197a52b9a5af304af024bacd675f09.tar.gz xen-f423003436197a52b9a5af304af024bacd675f09.tar.bz2 xen-f423003436197a52b9a5af304af024bacd675f09.zip |
32-on-64: Fix error path from memory_op() hypercall.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/common/compat')
-rw-r--r-- | xen/common/compat/memory.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c index 53628d7a35..5596c5d73a 100644 --- a/xen/common/compat/memory.c +++ b/xen/common/compat/memory.c @@ -258,7 +258,8 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE(void) compat) compat_pfn_t pfn = nat.rsrv->extent_start.p[start_extent]; BUG_ON(pfn != nat.rsrv->extent_start.p[start_extent]); - if ( __copy_to_compat_offset(cmp.rsrv.extent_start, start_extent, &pfn, 1) ) + if ( __copy_to_compat_offset(cmp.rsrv.extent_start, + start_extent, &pfn, 1) ) { if ( split >= 0 ) { @@ -275,6 +276,10 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE(void) compat) break; } } + + /* Bail if there was an error. */ + if ( (split >= 0) && (end_extent != nat.rsrv->nr_extents) ) + split = 0; } else start_extent = end_extent; |