memory: fix compat handling of XENMEM_access_op
authorJan Beulich <jbeulich@suse.com>
Fri, 2 Sep 2016 12:19:51 +0000 (14:19 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 2 Sep 2016 12:19:51 +0000 (14:19 +0200)
Within compat_memory_op() this needs to be placed in the first switch()
statement, or it ends up being dead code (as that first switch() has a
default case chaining to compat_arch_memory_op()).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/compat/memory.c

index 20c7671ffe9e9a46935ee9251c8bb479e3e410c0..579040ea1f2b38fcd1bb9c3d698287b13aef61b3 100644 (file)
@@ -320,6 +320,11 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             break;
         }
 
+        case XENMEM_access_op:
+            return mem_access_memop(cmd,
+                                    guest_handle_cast(compat,
+                                                      xen_mem_access_op_t));
+
         case XENMEM_get_vnumainfo:
         {
             enum XLAT_vnuma_topology_info_vdistance vdistance =
@@ -495,10 +500,6 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             break;
         }
 
-        case XENMEM_access_op:
-            rc = mem_access_memop(cmd, guest_handle_cast(compat, xen_mem_access_op_t));
-            break;
-
         case XENMEM_add_to_physmap_batch:
             start_extent = end_extent;
             break;