Skip to content
Snippets Groups Projects
Commit 3e184877 authored by Hou Zhiqiang's avatar Hou Zhiqiang Committed by Ramon Fried
Browse files

Fix a memory leak issue in the RX port initialization.

parent a298d4fb
No related branches found
No related tags found
No related merge requests found
......@@ -288,8 +288,10 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)
/* alloc Rx buffer from main memory */
rx_buf_pool = malloc(MAX_RXBUF_LEN * RX_BD_RING_SIZE);
if (!rx_buf_pool)
if (!rx_buf_pool) {
free(rx_bd_ring_base);
return -ENOMEM;
}
memset(rx_buf_pool, 0, MAX_RXBUF_LEN * RX_BD_RING_SIZE);
debug("%s: rx_buf_pool = %p\n", __func__, rx_buf_pool);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment