# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Node ID 2720886bc12276e994a4b61d07201bd173c8c96c
# Parent 5fcc346d6fe086436977a9b171f2bdb3a177d828
fix dead lock.
added spin_unlock() in case error occurs.
Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
diff -r 5fcc346d6fe0 -r 2720886bc122
linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c Thu Jan 26
11:31:28 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c Thu Feb 2
14:25:13 2006 +0900
@@ -106,8 +106,10 @@
BUG_ON(HYPERVISOR_event_channel_op(&op) != 0 );
evtchn = op.u.bind_virq.port;
- if (!unbound_irq(evtchn))
- return -EINVAL;
+ if (!unbound_irq(evtchn)) {
+ evtchn = -EINVAL;
+ goto out;
+ }
evtchns[evtchn].handler = handler;
evtchns[evtchn].dev_id = dev_id;
@@ -115,6 +117,7 @@
irq_info[evtchn] = mk_irq_info(IRQT_VIRQ, virq, evtchn);
unmask_evtchn(evtchn);
+out:
spin_unlock(&irq_mapping_update_lock);
return evtchn;
}
@@ -125,8 +128,10 @@
{
spin_lock(&irq_mapping_update_lock);
- if (!unbound_irq(evtchn))
- return -EINVAL;
+ if (!unbound_irq(evtchn)) {
+ evtchn = -EINVAL;
+ goto out;
+ }
evtchns[evtchn].handler = handler;
evtchns[evtchn].dev_id = dev_id;
@@ -134,6 +139,7 @@
irq_info[evtchn] = mk_irq_info(IRQT_EVTCHN, 0, evtchn);
unmask_evtchn(evtchn);
+out:
spin_unlock(&irq_mapping_update_lock);
return evtchn;
}
@@ -158,7 +164,7 @@
spin_lock(&irq_mapping_update_lock);
if (unbound_irq(irq))
- return;
+ goto out;
op.cmd = EVTCHNOP_close;
op.u.close.port = evtchn;
@@ -179,6 +185,7 @@
evtchns[evtchn].handler = NULL;
evtchns[evtchn].opened = 0;
+out:
spin_unlock(&irq_mapping_update_lock);
}
--
yamahata
8672:2720886bc122.patch
Description: Text document
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|