[zaptel-commits] mattf: branch 1.4 r2359 - /branches/1.4/zaptel-base.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Fri Mar 30 14:03:19 MST 2007


Author: mattf
Date: Fri Mar 30 16:03:19 2007
New Revision: 2359

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2359
Log:
Fix potential spinlock recursion issue.

Modified:
    branches/1.4/zaptel-base.c

Modified: branches/1.4/zaptel-base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/zaptel-base.c?view=diff&rev=2359&r1=2358&r2=2359
==============================================================================
--- branches/1.4/zaptel-base.c (original)
+++ branches/1.4/zaptel-base.c Fri Mar 30 16:03:19 2007
@@ -6267,6 +6267,22 @@
 	__putbuf_chunk(ss, rxb, ZT_CHUNKSIZE);
 }
 
+void __zt_hdlc_abort(struct zt_chan *ss, int event)
+{
+	if (ss->inreadbuf >= 0)
+		ss->readidx[ss->inreadbuf] = 0;
+	if ((ss->flags & ZT_FLAG_OPEN) && !ss->span->alarms)
+		__qevent(ss->master, event);
+}
+
+extern void zt_hdlc_abort(struct zt_chan *ss, int event)
+{
+	unsigned long flags;
+	spin_lock_irqsave(&ss->lock, flags);
+	__zt_hdlc_abort(ss, event);
+	spin_unlock_irqrestore(&ss->lock, flags);
+}
+
 extern void zt_hdlc_putbuf(struct zt_chan *ss, unsigned char *rxb, int bytes)
 {
 	unsigned long flags;
@@ -6296,20 +6312,9 @@
 #ifdef CONFIG_ZAPATA_DEBUG
 		printk("HDLC frame isn't fit into buffer space\n");
 #endif
-		zt_hdlc_abort(ss, ZT_EVENT_OVERRUN);
+		__zt_hdlc_abort(ss, ZT_EVENT_OVERRUN);
 	}
 	res = left;
-	spin_unlock_irqrestore(&ss->lock, flags);
-}
-
-extern void zt_hdlc_abort(struct zt_chan *ss, int event)
-{
-	unsigned long flags;
-	spin_lock_irqsave(&ss->lock, flags);
-	if (ss->inreadbuf >= 0)
-		ss->readidx[ss->inreadbuf] = 0;
-	if ((ss->flags & ZT_FLAG_OPEN) && !ss->span->alarms)
-		__qevent(ss->master, event);
 	spin_unlock_irqrestore(&ss->lock, flags);
 }
 



More information about the zaptel-commits mailing list