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>
Fri, 13 Jul 2018 14:39:46 +0000 (16:39 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.c

index c806e289b55d5af8051e155028e894af956226b0..8dde2b828c7da9013019ce2277b14481827247a5 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);
@@ -856,14 +856,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);