[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] Revert 19661:326b24bfa9f9 "Free pirq_to_evtchn/pirq_mask..."
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1243585370 -3600 # Node ID 527b628b8e83d2f85e22892e843dee75978c9d5f # Parent f3bed18decfcc86f075e436a369a3556f4bef970 Revert 19661:326b24bfa9f9 "Free pirq_to_evtchn/pirq_mask..." Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx> --- xen/common/domain.c | 11 +++++++++++ xen/common/event_channel.c | 24 +----------------------- 2 files changed, 12 insertions(+), 23 deletions(-) diff -r f3bed18decfc -r 527b628b8e83 xen/common/domain.c --- a/xen/common/domain.c Fri May 29 09:19:30 2009 +0100 +++ b/xen/common/domain.c Fri May 29 09:22:50 2009 +0100 @@ -261,6 +261,13 @@ struct domain *domain_create( 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; @@ -303,7 +310,11 @@ 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 ) diff -r f3bed18decfc -r 527b628b8e83 xen/common/event_channel.c --- a/xen/common/event_channel.c Fri May 29 09:19:30 2009 +0100 +++ b/xen/common/event_channel.c Fri May 29 09:22:50 2009 +0100 @@ -1013,27 +1013,10 @@ int evtchn_init(struct domain *d) int evtchn_init(struct domain *d) { spin_lock_init(&d->event_lock); - - 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 ( get_free_port(d) != 0 ) - goto fail; + return -EINVAL; evtchn_from_port(d, 0)->state = ECS_RESERVED; - return 0; - - fail: - xfree(d->pirq_to_evtchn); - d->pirq_to_evtchn = NULL; - xfree(d->pirq_mask); - d->pirq_mask = NULL; - return -ENOMEM; } @@ -1061,11 +1044,6 @@ void evtchn_destroy(struct domain *d) d->evtchn[i] = NULL; } spin_unlock(&d->event_lock); - - xfree(d->pirq_to_evtchn); - d->pirq_to_evtchn = NULL; - xfree(d->pirq_mask); - d->pirq_mask = NULL; } static void domain_dump_evtchn_info(struct domain *d) _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |