mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Acked-by: Peter P Waskiewicz Jr <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
936332b8e0
commit
fd3686a842
1 changed files with 6 additions and 2 deletions
|
|
@ -935,10 +935,12 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
|
|||
if (skb->prev)
|
||||
skb = ixgbe_transform_rsc_queue(skb, &(rx_ring->rsc_count));
|
||||
if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
|
||||
if (IXGBE_RSC_CB(skb)->dma)
|
||||
if (IXGBE_RSC_CB(skb)->dma) {
|
||||
pci_unmap_single(pdev, IXGBE_RSC_CB(skb)->dma,
|
||||
rx_ring->rx_buf_len,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
IXGBE_RSC_CB(skb)->dma = 0;
|
||||
}
|
||||
if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED)
|
||||
rx_ring->rsc_count += skb_shinfo(skb)->nr_frags;
|
||||
else
|
||||
|
|
@ -3126,10 +3128,12 @@ static void ixgbe_clean_rx_ring(struct ixgbe_adapter *adapter,
|
|||
rx_buffer_info->skb = NULL;
|
||||
do {
|
||||
struct sk_buff *this = skb;
|
||||
if (IXGBE_RSC_CB(this)->dma)
|
||||
if (IXGBE_RSC_CB(this)->dma) {
|
||||
pci_unmap_single(pdev, IXGBE_RSC_CB(this)->dma,
|
||||
rx_ring->rx_buf_len,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
IXGBE_RSC_CB(this)->dma = 0;
|
||||
}
|
||||
skb = skb->prev;
|
||||
dev_kfree_skb(this);
|
||||
} while (skb);
|
||||
|
|
|
|||
Loading…
Reference in a new issue