net: stmmac: Add missing call to dev_kfree_skb()
authorJose Abreu <Jose.Abreu@synopsys.com>
Fri, 20 Oct 2017 13:37:34 +0000 (14:37 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 Oct 2017 01:50:40 +0000 (02:50 +0100)
When RX HW timestamp is enabled and a frame is discarded we are
not freeing the skb but instead only setting to NULL the entry.

Add a call to dev_kfree_skb_any() so that skb entry is correctly
freed.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 1763e48c84e2090678f4ffc1b55cf1d7a62382e4..d67638c7078eb42ea111b82a1d97a6c67fa605de 100644 (file)
@@ -3333,6 +3333,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
                                 * them in stmmac_rx_refill() function so that
                                 * device can reuse it.
                                 */
+                               dev_kfree_skb_any(rx_q->rx_skbuff[entry]);
                                rx_q->rx_skbuff[entry] = NULL;
                                dma_unmap_single(priv->device,
                                                 rx_q->rx_skbuff_dma[entry],