ramips: ethernet: use skb_free_frag to free fragments
authorFelix Fietkau <nbd@nbd.name>
Thu, 12 Jul 2018 15:18:37 +0000 (17:18 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 12 Jul 2018 16:43:53 +0000 (18:43 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c

index e68ca204ed9e7d583b5850e2ccaf9fd22477509a..8dcc17774b50f68afd4ba92ac07d270dccc5d6d0 100644 (file)
@@ -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);
@@ -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);