]> xenbits.xensource.com Git - xen.git/commitdiff
[XEN] Shadow: fix locking in error path.
authorTim Deegan <Tim.Deegan@xensource.com>
Mon, 8 Oct 2007 08:40:49 +0000 (09:40 +0100)
committerTim Deegan <Tim.Deegan@xensource.com>
Mon, 8 Oct 2007 08:40:49 +0000 (09:40 +0100)
Signed-off-by: TIm Deegan <Tim.Deegan@xensource.com>
xen/arch/x86/mm/shadow/common.c

index 04bc55deb4b1a2d0b1fbcac4fb0b1591547ee731..97da7cf484c74099ebf72282e594163966053f04 100644 (file)
@@ -2372,13 +2372,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