From f8129a95414931c0b8e333963181548bb0f6d670 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Mon, 27 Dec 2010 21:47:35 +0900 Subject: [PATCH] Staging: rtl8192e: Unlock spinlock in once place only Signed-off-by: Mike McCormack Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/r8192E_core.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c index f006f6700285..075245b92a87 100644 --- a/drivers/staging/rtl8192e/r8192E_core.c +++ b/drivers/staging/rtl8192e/r8192E_core.c @@ -6185,12 +6185,13 @@ static irqreturn_t rtl8192_interrupt(int irq, void *netdev) struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); unsigned long flags; u32 inta; + irqreturn_t ret = IRQ_HANDLED; + + spin_lock_irqsave(&priv->irq_th_lock, flags); /* We should return IRQ_NONE, but for now let me keep this */ if (priv->irq_enabled == 0) - return IRQ_HANDLED; - - spin_lock_irqsave(&priv->irq_th_lock,flags); + goto out_unlock; /* ISR: 4bytes */ @@ -6199,18 +6200,16 @@ static irqreturn_t rtl8192_interrupt(int irq, void *netdev) priv->stats.shints++; if (!inta) { - spin_unlock_irqrestore(&priv->irq_th_lock, flags); - return IRQ_HANDLED; /* * most probably we can safely return IRQ_NONE, * but for now is better to avoid problems */ + goto out_unlock; } if (inta == 0xffff) { /* HW disappared */ - spin_unlock_irqrestore(&priv->irq_th_lock, flags); - return IRQ_HANDLED; + goto out_unlock; } priv->stats.ints++; @@ -6218,10 +6217,8 @@ static irqreturn_t rtl8192_interrupt(int irq, void *netdev) DMESG("NIC irq %x",inta); #endif - if (!netif_running(dev)) { - spin_unlock_irqrestore(&priv->irq_th_lock, flags); - return IRQ_HANDLED; - } + if (!netif_running(dev)) + goto out_unlock; if (inta & IMR_TBDOK) { RT_TRACE(COMP_INTR, "beacon ok interrupt!\n"); @@ -6304,9 +6301,10 @@ static irqreturn_t rtl8192_interrupt(int irq, void *netdev) rtl8192_tx_isr(dev, VO_QUEUE); } +out_unlock: spin_unlock_irqrestore(&priv->irq_th_lock, flags); - return IRQ_HANDLED; + return ret; } void EnableHWSecurityConfig8192(struct net_device *dev) -- 2.20.1