From 8cd48d9f9c1afd7c9929333df7bff60dc8f00d73 Mon Sep 17 00:00:00 2001 From: Liu Zhi Fu Date: Sun, 20 Nov 2016 17:05:44 +0800 Subject: [PATCH] lwip: rework for low_level_output --- components/lwip/port/netif/wlanif.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/lwip/port/netif/wlanif.c b/components/lwip/port/netif/wlanif.c index 2c2d75b74d..3a4688004b 100755 --- a/components/lwip/port/netif/wlanif.c +++ b/components/lwip/port/netif/wlanif.c @@ -126,8 +126,9 @@ low_level_output(struct netif *netif, struct pbuf *p) return ERR_IF; } - if(q->next !=NULL) - { + if(q->next == NULL) { + ret = esp_wifi_internal_tx(wifi_if, q->payload, q->len); + } else { LWIP_DEBUGF(PBUF_DEBUG, ("low_level_output: pbuf is a list, application may has bug")); printf("low level_output: len=%d\n", p->tot_len); q = pbuf_alloc(PBUF_RAW_TX, p->tot_len, PBUF_RAM); @@ -136,10 +137,10 @@ low_level_output(struct netif *netif, struct pbuf *p) } else { return ERR_MEM; } + ret = esp_wifi_internal_tx(wifi_if, q->payload, q->len); + pbuf_free(q); } - ret = esp_wifi_internal_tx(wifi_if, q->payload, q->len); - pbuf_free(q); return ret; } -- 2.40.0