Commit ef1b2664 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Kamal Mostafa

tg3: Call dev_kfree_skby_any instead of dev_kfree_skb.

commit 497a27b9 upstream.

Replace dev_kfree_skb with dev_kfree_skb_any in functions that can
be called in hard irq and other contexts.
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent b343941e
...@@ -6577,7 +6577,7 @@ static void tg3_tx(struct tg3_napi *tnapi) ...@@ -6577,7 +6577,7 @@ static void tg3_tx(struct tg3_napi *tnapi)
pkts_compl++; pkts_compl++;
bytes_compl += skb->len; bytes_compl += skb->len;
dev_kfree_skb(skb); dev_kfree_skb_any(skb);
if (unlikely(tx_bug)) { if (unlikely(tx_bug)) {
tg3_tx_recover(tp); tg3_tx_recover(tp);
...@@ -6909,7 +6909,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) ...@@ -6909,7 +6909,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
if (len > (tp->dev->mtu + ETH_HLEN) && if (len > (tp->dev->mtu + ETH_HLEN) &&
skb->protocol != htons(ETH_P_8021Q) && skb->protocol != htons(ETH_P_8021Q) &&
skb->protocol != htons(ETH_P_8021AD)) { skb->protocol != htons(ETH_P_8021AD)) {
dev_kfree_skb(skb); dev_kfree_skb_any(skb);
goto drop_it_no_recycle; goto drop_it_no_recycle;
} }
...@@ -7792,7 +7792,7 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, ...@@ -7792,7 +7792,7 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
/* Make sure the mapping succeeded */ /* Make sure the mapping succeeded */
if (pci_dma_mapping_error(tp->pdev, new_addr)) { if (pci_dma_mapping_error(tp->pdev, new_addr)) {
dev_kfree_skb(new_skb); dev_kfree_skb_any(new_skb);
ret = -1; ret = -1;
} else { } else {
u32 save_entry = *entry; u32 save_entry = *entry;
...@@ -7807,13 +7807,13 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, ...@@ -7807,13 +7807,13 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
new_skb->len, base_flags, new_skb->len, base_flags,
mss, vlan)) { mss, vlan)) {
tg3_tx_skb_unmap(tnapi, save_entry, -1); tg3_tx_skb_unmap(tnapi, save_entry, -1);
dev_kfree_skb(new_skb); dev_kfree_skb_any(new_skb);
ret = -1; ret = -1;
} }
} }
} }
dev_kfree_skb(skb); dev_kfree_skb_any(skb);
*pskb = new_skb; *pskb = new_skb;
return ret; return ret;
} }
...@@ -7856,7 +7856,7 @@ static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb) ...@@ -7856,7 +7856,7 @@ static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb)
} while (segs); } while (segs);
tg3_tso_bug_end: tg3_tso_bug_end:
dev_kfree_skb(skb); dev_kfree_skb_any(skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
...@@ -8094,7 +8094,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -8094,7 +8094,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
tg3_tx_skb_unmap(tnapi, tnapi->tx_prod, --i); tg3_tx_skb_unmap(tnapi, tnapi->tx_prod, --i);
tnapi->tx_buffers[tnapi->tx_prod].skb = NULL; tnapi->tx_buffers[tnapi->tx_prod].skb = NULL;
drop: drop:
dev_kfree_skb(skb); dev_kfree_skb_any(skb);
drop_nofree: drop_nofree:
tp->tx_dropped++; tp->tx_dropped++;
return NETDEV_TX_OK; return NETDEV_TX_OK;
......
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