Commit f8129a95 authored by Mike McCormack's avatar Mike McCormack Committed by Greg Kroah-Hartman

Staging: rtl8192e: Unlock spinlock in once place only

Signed-off-by: default avatarMike McCormack <mikem@ring3k.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b2cf8d48
...@@ -6185,12 +6185,13 @@ static irqreturn_t rtl8192_interrupt(int irq, void *netdev) ...@@ -6185,12 +6185,13 @@ static irqreturn_t rtl8192_interrupt(int irq, void *netdev)
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
unsigned long flags; unsigned long flags;
u32 inta; 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 */ /* We should return IRQ_NONE, but for now let me keep this */
if (priv->irq_enabled == 0) if (priv->irq_enabled == 0)
return IRQ_HANDLED; goto out_unlock;
spin_lock_irqsave(&priv->irq_th_lock,flags);
/* ISR: 4bytes */ /* ISR: 4bytes */
...@@ -6199,18 +6200,16 @@ static irqreturn_t rtl8192_interrupt(int irq, void *netdev) ...@@ -6199,18 +6200,16 @@ static irqreturn_t rtl8192_interrupt(int irq, void *netdev)
priv->stats.shints++; priv->stats.shints++;
if (!inta) { if (!inta) {
spin_unlock_irqrestore(&priv->irq_th_lock, flags);
return IRQ_HANDLED;
/* /*
* most probably we can safely return IRQ_NONE, * most probably we can safely return IRQ_NONE,
* but for now is better to avoid problems * but for now is better to avoid problems
*/ */
goto out_unlock;
} }
if (inta == 0xffff) { if (inta == 0xffff) {
/* HW disappared */ /* HW disappared */
spin_unlock_irqrestore(&priv->irq_th_lock, flags); goto out_unlock;
return IRQ_HANDLED;
} }
priv->stats.ints++; priv->stats.ints++;
...@@ -6218,10 +6217,8 @@ static irqreturn_t rtl8192_interrupt(int irq, void *netdev) ...@@ -6218,10 +6217,8 @@ static irqreturn_t rtl8192_interrupt(int irq, void *netdev)
DMESG("NIC irq %x",inta); DMESG("NIC irq %x",inta);
#endif #endif
if (!netif_running(dev)) { if (!netif_running(dev))
spin_unlock_irqrestore(&priv->irq_th_lock, flags); goto out_unlock;
return IRQ_HANDLED;
}
if (inta & IMR_TBDOK) { if (inta & IMR_TBDOK) {
RT_TRACE(COMP_INTR, "beacon ok interrupt!\n"); RT_TRACE(COMP_INTR, "beacon ok interrupt!\n");
...@@ -6304,9 +6301,10 @@ static irqreturn_t rtl8192_interrupt(int irq, void *netdev) ...@@ -6304,9 +6301,10 @@ static irqreturn_t rtl8192_interrupt(int irq, void *netdev)
rtl8192_tx_isr(dev, VO_QUEUE); rtl8192_tx_isr(dev, VO_QUEUE);
} }
out_unlock:
spin_unlock_irqrestore(&priv->irq_th_lock, flags); spin_unlock_irqrestore(&priv->irq_th_lock, flags);
return IRQ_HANDLED; return ret;
} }
void EnableHWSecurityConfig8192(struct net_device *dev) void EnableHWSecurityConfig8192(struct net_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment