[mISDN PATCH v2 04/19] Fixed missing spin lock on pipeline process

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Karsten Keil
Date: Friday, May 22, 2009 - 2:04 pm

From: Andreas Eversberg <andreas@eversberg.eu>

Need to protect the complete pipeline.

Signed-off-by: Andreas Eversberg <andreas@eversberg.eu>
Signed-off-by: Karsten Keil <keil@b1-systems.de>
---
 drivers/isdn/mISDN/dsp_core.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c
index 1c49368..621ea9b 100644
--- a/drivers/isdn/mISDN/dsp_core.c
+++ b/drivers/isdn/mISDN/dsp_core.c
@@ -704,6 +704,8 @@ dsp_function(struct mISDNchannel *ch,  struct sk_buff *skb)
 			break;
 		}
 
+		spin_lock_irqsave(&dsp_lock, flags);
+
 		/* decrypt if enabled */
 		if (dsp->bf_enable)
 			dsp_bf_decrypt(dsp, skb->data, skb->len);
@@ -741,11 +743,11 @@ dsp_function(struct mISDNchannel *ch,  struct sk_buff *skb)
 			}
 		}
 		/* we need to process receive data if software */
-		spin_lock_irqsave(&dsp_lock, flags);
 		if (dsp->pcm_slot_tx < 0 && dsp->pcm_slot_rx < 0) {
 			/* process data from card at cmx */
 			dsp_cmx_receive(dsp, skb);
 		}
+
 		spin_unlock_irqrestore(&dsp_lock, flags);
 
 		if (dsp->rx_disabled) {
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[mISDN PATCH v2 00/19] mISDN patchset for next, Karsten Keil, (Fri May 22, 1:42 pm)
[mISDN PATCH v2 04/19] Fixed missing spin lock on pipeline ..., Karsten Keil, (Fri May 22, 2:04 pm)
[mISDN PATCH v2 07/19] Fix DTMF locking bug issue, Karsten Keil, (Fri May 22, 2:04 pm)
[mISDN PATCH v2 06/19] Added layer-1-hold feature, Karsten Keil, (Fri May 22, 2:04 pm)
[mISDN PATCH v2 09/19] Fix TEI and SAPI handling, Karsten Keil, (Fri May 22, 2:04 pm)
[mISDN PATCH v2 12/19] Fix skb leak in error cases, Karsten Keil, (Fri May 22, 2:04 pm)
[mISDN PATCH v2 15/19] Add PCI ID for Junghanns 8S card, Karsten Keil, (Fri May 22, 2:04 pm)
[mISDN PATCH v2 17/19] Cleanup debug messages, Karsten Keil, (Fri May 22, 2:04 pm)
Re: [mISDN PATCH v2 00/19] mISDN patchset for next, David Miller, (Mon May 25, 12:53 am)