]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
x86: fold identical error paths in xenmem_add_to_physmap_one()
authorJan Beulich <jbeulich@suse.com>
Thu, 22 Jun 2017 07:52:32 +0000 (09:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 22 Jun 2017 07:52:32 +0000 (09:52 +0200)
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/mm.c

index 19050d62b4af87f91c666812bfd83c550a599b1a..e0abff00fdc8bdf09864bba8d273f7c85ba83701 100644 (file)
@@ -4887,11 +4887,8 @@ int xenmem_add_to_physmap_one(
 
     if ( !paging_mode_translate(d) || (mfn == 0) )
     {
-        if ( page )
-            put_page(page);
-        if ( space == XENMAPSPACE_gmfn || space == XENMAPSPACE_gmfn_range )
-            put_gfn(d, gfn);
-        return -EINVAL;
+        rc = -EINVAL;
+        goto put_both;
     }
 
     /* Remove previously mapped page if it was present. */