xen/arm: implement arch_domain_destroy
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 5 Feb 2013 11:31:08 +0000 (11:31 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 5 Feb 2013 11:31:08 +0000 (11:31 +0000)
Implement arch_domain_destroy, use it in the error path of
arch_domain_create.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/domain.c

index 59d8d73be4a452bd90ed457ce181e1adf2c3709b..48dce80ed81756d218c013b88a937440c88a08b4 100644 (file)
@@ -437,20 +437,17 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
 
 fail:
     d->is_dying = DOMDYING_dead;
-    free_xenheap_page(d->shared_info);
-
-    p2m_teardown(d);
-
-    domain_vgic_free(d);
-    domain_uart0_free(d);
+    arch_domain_destroy(d);
 
     return rc;
 }
 
 void arch_domain_destroy(struct domain *d)
 {
-    /* p2m_destroy */
-    /* domain_vgic_destroy */
+    p2m_teardown(d);
+    domain_vgic_free(d);
+    domain_uart0_free(d);
+    free_xenheap_page(d->shared_info);
 }
 
 static int is_guest_psr(uint32_t psr)