WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [IA64] evtchn_ia64 spin lock - fix dead lock

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [IA64] evtchn_ia64 spin lock - fix dead lock
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 02 Mar 2006 12:16:12 +0000
Delivery-date: Thu, 02 Mar 2006 12:17:51 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User awilliam@xxxxxxxxxxx
# 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@xxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [IA64] evtchn_ia64 spin lock - fix dead lock, Xen patchbot -unstable <=