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);
break;
/* alloc new buffer */
- new_data = netdev_alloc_frag(ring->frag_size);
+ new_data = napi_alloc_frag(ring->frag_size);
if (unlikely(!new_data)) {
stats->rx_dropped++;
goto release_desc;
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);