]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mm: Simplify promote_l4_table()'s exit semantics
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 9 Oct 2018 12:48:57 +0000 (13:48 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 17 Dec 2019 20:40:57 +0000 (20:40 +0000)
promote_l4_table() is different from its lower level helpers, by having an
extra return path out of the middle of the loop in the case of a failure.

Break from the loop, which is consistent with the other helpers, and
functionally equivalent.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/mm.c

index c14c677a62f0ba9798b93a395814f2b1349d7839..594f1bd29043b02dedc02335b3fae007d54322f0 100644 (file)
@@ -1856,10 +1856,7 @@ static int promote_l4_table(struct page_info *page)
             }
         }
         if ( rc < 0 )
-        {
-            unmap_domain_page(pl4e);
-            return rc;
-        }
+            break;
 
         pl4e[i] = adjust_guest_l4e(l4e, d);
     }