Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TW#27236] Bug in lwip/port/esp32/netif/ethernetif.c #2670

Closed
wayneuroda opened this issue Nov 6, 2018 · 1 comment
Closed

[TW#27236] Bug in lwip/port/esp32/netif/ethernetif.c #2670

wayneuroda opened this issue Nov 6, 2018 · 1 comment
Assignees

Comments

@wayneuroda
Copy link

There is a memory leak bug in some error handling code in ethernetif.c

  /* full packet send to tcpip_thread to process */
if (netif->input(p, netif) != ERR_OK) {
  LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
  p->l2_owner = NULL;
  pbuf_free(p);
}

It is not correct to set p->l2_owner = NULL; before calling pbuf_free(p).

The same mistake is not present in wlanif.c.

@Alvin1Zhang Alvin1Zhang changed the title Bug in lwip/port/esp32/netif/ethernetif.c [TW#27236] Bug in lwip/port/esp32/netif/ethernetif.c Nov 6, 2018
@liuzfesp
Copy link
Contributor

liuzfesp commented Nov 6, 2018

Thanks @wayneuroda for pointing this bug, we will fix it.

@suda-morris suda-morris self-assigned this Nov 6, 2018
@igrr igrr closed this as completed in 5fccb73 Nov 18, 2018
igrr pushed a commit that referenced this issue Nov 20, 2018
1. If L2_TO_L3_RX_BUF_MODE is not selected, we must assign l2_owner explictly before we call pbuf_free.
2. free intr resource in esp_eth_deinit

Closes #2670
catalinio pushed a commit to catalinio/pycom-esp-idf that referenced this issue Jun 28, 2019
1. If L2_TO_L3_RX_BUF_MODE is not selected, we must assign l2_owner explictly before we call pbuf_free.
2. free intr resource in esp_eth_deinit

Closes espressif/esp-idf#2670
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants