]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
[XEN] Shadow: fix locking in error path.
authorKeir Fraser <keir@xensource.com>
Mon, 8 Oct 2007 09:59:44 +0000 (10:59 +0100)
committerKeir Fraser <keir@xensource.com>
Mon, 8 Oct 2007 09:59:44 +0000 (10:59 +0100)
Signed-off-by: TIm Deegan <Tim.Deegan@xensource.com>
xen-unstable changeset:   16076:0c2535407828d6473a2b5730155c66e76f9a0512
xen-unstable date:        Mon Oct 08 09:40:49 2007 +0100

xen/arch/x86/mm/shadow/common.c

index 7e53c23a3657e1e39b099b8f1a5b79ecc50e8225..a27e69a3a94792e983fe57917460ddaf4716266e 100644 (file)
@@ -2451,13 +2451,13 @@ int shadow_enable(struct domain *d, u32 mode)
         unsigned int r;
         shadow_lock(d);                
         r = sh_set_allocation(d, 256, NULL); /* Use at least 1MB */
-        shadow_unlock(d);
         if ( r != 0 )
         {
             sh_set_allocation(d, 0, NULL);
             rv = -ENOMEM;
-            goto out_unlocked;
+            goto out_locked;
         }        
+        shadow_unlock(d);
     }
 
     /* Init the P2M table.  Must be done before we take the shadow lock