aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorMallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>2010-03-19 00:41:33 -0400
committerDavid S. Miller <davem@davemloft.net>2010-03-20 00:00:44 -0400
commitfd3686a842717b890fbe3024b83a616c54d5dba0 (patch)
tree6a1dc099b24dddc41c0d1367c46ece014ce1d992 /drivers/net/ixgbe
parent936332b8e00103fc20eb7e915c9a3bcb2835a11a (diff)
ixgbe: Set IXGBE_RSC_CB(skb)->DMA field to zero after unmapping the address
As per Simon Horman's feedback set IXGBE_RSC_CB(skb)->dma to zero after unmapping HWRSC DMA address to avoid double freeing. Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 18b5b217f310..d75c46ff31f6 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -935,10 +935,12 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
935 if (skb->prev) 935 if (skb->prev)
936 skb = ixgbe_transform_rsc_queue(skb, &(rx_ring->rsc_count)); 936 skb = ixgbe_transform_rsc_queue(skb, &(rx_ring->rsc_count));
937 if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { 937 if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
938 if (IXGBE_RSC_CB(skb)->dma) 938 if (IXGBE_RSC_CB(skb)->dma) {
939 pci_unmap_single(pdev, IXGBE_RSC_CB(skb)->dma, 939 pci_unmap_single(pdev, IXGBE_RSC_CB(skb)->dma,
940 rx_ring->rx_buf_len, 940 rx_ring->rx_buf_len,
941 PCI_DMA_FROMDEVICE); 941 PCI_DMA_FROMDEVICE);
942 IXGBE_RSC_CB(skb)->dma = 0;
943 }
942 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) 944 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED)
943 rx_ring->rsc_count += skb_shinfo(skb)->nr_frags; 945 rx_ring->rsc_count += skb_shinfo(skb)->nr_frags;
944 else 946 else
@@ -3126,10 +3128,12 @@ static void ixgbe_clean_rx_ring(struct ixgbe_adapter *adapter,
3126 rx_buffer_info->skb = NULL; 3128 rx_buffer_info->skb = NULL;
3127 do { 3129 do {
3128 struct sk_buff *this = skb; 3130 struct sk_buff *this = skb;
3129 if (IXGBE_RSC_CB(this)->dma) 3131 if (IXGBE_RSC_CB(this)->dma) {
3130 pci_unmap_single(pdev, IXGBE_RSC_CB(this)->dma, 3132 pci_unmap_single(pdev, IXGBE_RSC_CB(this)->dma,
3131 rx_ring->rx_buf_len, 3133 rx_ring->rx_buf_len,
3132 PCI_DMA_FROMDEVICE); 3134 PCI_DMA_FROMDEVICE);
3135 IXGBE_RSC_CB(this)->dma = 0;
3136 }
3133 skb = skb->prev; 3137 skb = skb->prev;
3134 dev_kfree_skb(this); 3138 dev_kfree_skb(this);
3135 } while (skb); 3139 } while (skb);