WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Free pirq_array/pirq_to_evtchn in complet

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Free pirq_array/pirq_to_evtchn in complete_domain_destroy().
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 30 May 2009 02:30:18 -0700
Delivery-date: Sat, 30 May 2009 02:31:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1243585609 -3600
# Node ID ae5bd69227d14e27bdd6753b9d21504a0b0242be
# Parent  527b628b8e83d2f85e22892e843dee75978c9d5f
Free pirq_array/pirq_to_evtchn in complete_domain_destroy().

Also rejig code slightly in domain_create().

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/common/domain.c |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff -r 527b628b8e83 -r ae5bd69227d1 xen/common/domain.c
--- a/xen/common/domain.c       Fri May 29 09:22:50 2009 +0100
+++ b/xen/common/domain.c       Fri May 29 09:26:49 2009 +0100
@@ -255,19 +255,20 @@ struct domain *domain_create(
         d->is_paused_by_controller = 1;
         atomic_inc(&d->pause_count);
 
-        d->nr_pirqs = nr_irqs +
-                      (domid ? extra_domU_irqs :
-                               extra_dom0_irqs ?: nr_irqs);
+        d->nr_pirqs = (nr_irqs +
+                       (domid ? extra_domU_irqs :
+                        extra_dom0_irqs ?: nr_irqs));
+        d->pirq_to_evtchn = xmalloc_array(u16, d->nr_pirqs);
+        d->pirq_mask = xmalloc_array(
+            unsigned long, BITS_TO_LONGS(d->nr_pirqs));
+        if ( (d->pirq_to_evtchn == NULL) || (d->pirq_mask == NULL) )
+            goto fail;
+        memset(d->pirq_to_evtchn, 0, d->nr_pirqs * sizeof(*d->pirq_to_evtchn));
+        bitmap_zero(d->pirq_mask, d->nr_pirqs);
+
         if ( evtchn_init(d) != 0 )
             goto fail;
         init_status |= INIT_evtchn;
-        d->pirq_to_evtchn = xmalloc_array(u16, d->nr_pirqs);
-        d->pirq_mask = xmalloc_array(unsigned long,
-                                     BITS_TO_LONGS(d->nr_pirqs));
-        if ( !d->pirq_to_evtchn || !d->pirq_mask )
-            goto fail;
-        memset(d->pirq_to_evtchn, 0, d->nr_pirqs * sizeof(*d->pirq_to_evtchn));
-        bitmap_zero(d->pirq_mask, d->nr_pirqs);
 
         if ( grant_table_create(d) != 0 )
             goto fail;
@@ -310,15 +311,13 @@ struct domain *domain_create(
     if ( init_status & INIT_gnttab )
         grant_table_destroy(d);
     if ( init_status & INIT_evtchn )
-    {
-        xfree(d->pirq_mask);
-        xfree(d->pirq_to_evtchn);
         evtchn_destroy(d);
-    }
     if ( init_status & INIT_rangeset )
         rangeset_domain_destroy(d);
     if ( init_status & INIT_xsm )
         xsm_free_security_domain(d);
+    xfree(d->pirq_mask);
+    xfree(d->pirq_to_evtchn);
     free_domain_struct(d);
     return NULL;
 }
@@ -603,6 +602,9 @@ static void complete_domain_destroy(stru
     if ( d->target != NULL )
         put_domain(d->target);
 
+    xfree(d->pirq_mask);
+    xfree(d->pirq_to_evtchn);
+
     xsm_free_security_domain(d);
     free_domain_struct(d);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Free pirq_array/pirq_to_evtchn in complete_domain_destroy()., Xen patchbot-unstable <=