aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xen/common/event_channel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a0f293ff2e..0a6684c6d5 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -140,7 +140,6 @@ static int get_free_port(struct domain *d)
chn = xzalloc_array(struct evtchn, EVTCHNS_PER_BUCKET);
if ( unlikely(chn == NULL) )
return -ENOMEM;
- bucket_from_port(d, port) = chn;
for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ )
{
@@ -153,6 +152,8 @@ static int get_free_port(struct domain *d)
}
}
+ bucket_from_port(d, port) = chn;
+
return port;
}