Skip to content

Commit

Permalink
ramips: ethernet: use skb_free_frag to free fragments
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nbd168 committed Jul 12, 2018
1 parent 2eeb4b7 commit 01df4a2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static void fe_clean_rx(struct fe_priv *priv)
ring->rx_dma[i].rxd1,
ring->rx_buf_size,
DMA_FROM_DEVICE);
put_page(virt_to_head_page(ring->rx_data[i]));
skb_free_frag(ring->rx_data[i]);
}

kfree(ring->rx_data);
Expand Down Expand Up @@ -891,14 +891,14 @@ static int fe_poll_rx(struct napi_struct *napi, int budget,
ring->rx_buf_size,
DMA_FROM_DEVICE);
if (unlikely(dma_mapping_error(&netdev->dev, dma_addr))) {
put_page(virt_to_head_page(new_data));
skb_free_frag(new_data);
goto release_desc;
}

/* receive data */
skb = build_skb(data, ring->frag_size);
if (unlikely(!skb)) {
put_page(virt_to_head_page(new_data));
skb_free_frag(new_data);
goto release_desc;
}
skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);
Expand Down

0 comments on commit 01df4a2

Please sign in to comment.