]> git.hungrycats.org Git - linux/commitdiff
[PATCH] dmfe: don't free skb with local interrupts disabled
authorAndrew Morton <akpm@digeo.com>
Sun, 20 Apr 2003 07:26:00 +0000 (00:26 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 20 Apr 2003 07:26:00 +0000 (00:26 -0700)
dev_kfree_skb() can end up calling local_bh_enable() which goes BUG if local
interrupts are disabled.  Apparently it can deadlock.

So move the skb freeing outside the lock in the dmfe driver.  It will
decrease the lock hold time as well.

drivers/net/tulip/dmfe.c

index ee017a02ecbedf1f50bc5b85cf7f558149eb791c..b2d33c9ac274619770448b9708bda0dab3cbf208 100644 (file)
@@ -668,13 +668,13 @@ static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev)
        if ( db->tx_queue_cnt < TX_FREE_DESC_CNT )
                netif_wake_queue(dev);
 
-       /* free this SKB */
-       dev_kfree_skb(skb);
-
        /* Restore CR7 to enable interrupt */
        spin_unlock_irqrestore(&db->lock, flags);
        outl(db->cr7_data, dev->base_addr + DCR7);
 
+       /* free this SKB */
+       dev_kfree_skb(skb);
+
        return 0;
 }