xen/arm: Fix regression after commit d963923
authorJulien Grall <julien.grall@linaro.org>
Mon, 9 Dec 2013 18:34:10 +0000 (18:34 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 10 Dec 2013 09:27:36 +0000 (09:27 +0000)
The commit d963923  "xen: arm: correct return value of
raw_copy_{to/from}_guest_*, raw_clear_guest" doesn't permit to boot guest
on Xen ARM.

Remove the stray semicolon from the end of the if statement.

Also we want to get the right rc in the error arrays, so we need to do the
copy_to_guest_offset before checking the rc returned by
xenmem_add_to_physmap_one.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- expanded commit log ]

xen/arch/arm/mm.c

index 26ca58873a7fb8ca8c70b0c3003a3c60f4992ee4..654281afd305a75aed8f0ce5d7f7167a6fbd70f1 100644 (file)
@@ -1084,16 +1084,17 @@ static int xenmem_add_to_physmap_range(struct domain *d,
         rc = xenmem_add_to_physmap_one(d, xatpr->space,
                                        xatpr->foreign_domid,
                                        idx, gpfn);
-        if ( rc < 0 )
-            goto out;
 
         if ( unlikely(copy_to_guest_offset(xatpr->errs,
-                                           xatpr->size-1, &rc, 1)) );
+                                           xatpr->size-1, &rc, 1)) )
         {
             rc = -EFAULT;
             goto out;
         }
 
+        if ( rc < 0 )
+            goto out;
+
         xatpr->size--;
 
         /* Check for continuation if it's not the last interation */