Mailing List Archive

[IA64] evtchn_ia64 spin lock - fix dead lock
# HG changeset patch
# User awilliam@xenbuild.aw
# Node ID ecc8595f2c0b49684e40b4601f1a27f1df152528
# Parent 7b2399cb65081895440b0a53e972d632cebb2ef2
[IA64] evtchn_ia64 spin lock - fix dead lock

added spin_unlock() in case error occurs.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

diff -r 7b2399cb6508 -r ecc8595f2c0b 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 Feb 9 20:43:39 2006
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c Thu Feb 9 20:48:05 2006
@@ -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);
}


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