aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/xen/evtchn.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
index 8feecf01d55c..b6165e047f48 100644
--- a/drivers/xen/evtchn.c
+++ b/drivers/xen/evtchn.c
@@ -379,18 +379,12 @@ static long evtchn_ioctl(struct file *file,
379 if (unbind.port >= NR_EVENT_CHANNELS) 379 if (unbind.port >= NR_EVENT_CHANNELS)
380 break; 380 break;
381 381
382 spin_lock_irq(&port_user_lock);
383
384 rc = -ENOTCONN; 382 rc = -ENOTCONN;
385 if (get_port_user(unbind.port) != u) { 383 if (get_port_user(unbind.port) != u)
386 spin_unlock_irq(&port_user_lock);
387 break; 384 break;
388 }
389 385
390 disable_irq(irq_from_evtchn(unbind.port)); 386 disable_irq(irq_from_evtchn(unbind.port));
391 387
392 spin_unlock_irq(&port_user_lock);
393
394 evtchn_unbind_from_user(u, unbind.port); 388 evtchn_unbind_from_user(u, unbind.port);
395 389
396 rc = 0; 390 rc = 0;
@@ -490,26 +484,15 @@ static int evtchn_release(struct inode *inode, struct file *filp)
490 int i; 484 int i;
491 struct per_user_data *u = filp->private_data; 485 struct per_user_data *u = filp->private_data;
492 486
493 spin_lock_irq(&port_user_lock);
494
495 free_page((unsigned long)u->ring);
496
497 for (i = 0; i < NR_EVENT_CHANNELS; i++) { 487 for (i = 0; i < NR_EVENT_CHANNELS; i++) {
498 if (get_port_user(i) != u) 488 if (get_port_user(i) != u)
499 continue; 489 continue;
500 490
501 disable_irq(irq_from_evtchn(i)); 491 disable_irq(irq_from_evtchn(i));
502 }
503
504 spin_unlock_irq(&port_user_lock);
505
506 for (i = 0; i < NR_EVENT_CHANNELS; i++) {
507 if (get_port_user(i) != u)
508 continue;
509
510 evtchn_unbind_from_user(get_port_user(i), i); 492 evtchn_unbind_from_user(get_port_user(i), i);
511 } 493 }
512 494
495 free_page((unsigned long)u->ring);
513 kfree(u->name); 496 kfree(u->name);
514 kfree(u); 497 kfree(u);
515 498