ramips: ethernet: use skb_free_frag to free fragments

Signed-off-by: Felix Fietkau <nbd@nbd.name>
openwrt-19.07
Felix Fietkau 2018-07-12 17:18:37 +02:00
parent 2eeb4b78c6
commit 01df4a2565
1 changed files with 3 additions and 3 deletions

View File

@ -230,7 +230,7 @@ static void fe_clean_rx(struct fe_priv *priv)
ring->rx_dma[i].rxd1, ring->rx_dma[i].rxd1,
ring->rx_buf_size, ring->rx_buf_size,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
put_page(virt_to_head_page(ring->rx_data[i])); skb_free_frag(ring->rx_data[i]);
} }
kfree(ring->rx_data); kfree(ring->rx_data);
@ -891,14 +891,14 @@ static int fe_poll_rx(struct napi_struct *napi, int budget,
ring->rx_buf_size, ring->rx_buf_size,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
if (unlikely(dma_mapping_error(&netdev->dev, dma_addr))) { 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; goto release_desc;
} }
/* receive data */ /* receive data */
skb = build_skb(data, ring->frag_size); skb = build_skb(data, ring->frag_size);
if (unlikely(!skb)) { if (unlikely(!skb)) {
put_page(virt_to_head_page(new_data)); skb_free_frag(new_data);
goto release_desc; goto release_desc;
} }
skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN); skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);