Commit 8b7c9efa authored by Russell King's avatar Russell King Committed by David S. Miller

net: fec: ensure fec_enet_free_buffers() properly cleans the rings

Ensure that we do not double-free any allocations, and that any transmit
skbuffs are properly freed when we clean up the rings.
Acked-by: default avatarFugang Duan <B38611@freescale.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d6bf3143
...@@ -2079,8 +2079,13 @@ static void fec_enet_free_buffers(struct net_device *ndev) ...@@ -2079,8 +2079,13 @@ static void fec_enet_free_buffers(struct net_device *ndev)
} }
bdp = fep->tx_bd_base; bdp = fep->tx_bd_base;
for (i = 0; i < fep->tx_ring_size; i++) for (i = 0; i < fep->tx_ring_size; i++) {
kfree(fep->tx_bounce[i]); kfree(fep->tx_bounce[i]);
fep->tx_bounce[i] = NULL;
skb = fep->tx_skbuff[i];
fep->tx_skbuff[i] = NULL;
dev_kfree_skb(skb);
}
} }
static int fec_enet_alloc_buffers(struct net_device *ndev) static int fec_enet_alloc_buffers(struct net_device *ndev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment