From a3377c21b61961dc9d73f967db12d72272680185 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 30 Mar 2023 10:26:11 +0800 Subject: [PATCH] fix #260 pbuf assert --- .../hc32f4a0/third_party_driver/ethernet/ethernetif.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/ethernetif.c b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/ethernetif.c index f792d669f..6658a96e2 100644 --- a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/ethernetif.c +++ b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/ethernetif.c @@ -418,13 +418,7 @@ static struct pbuf *low_level_input(struct netif *netif) rxBuffer = (uint8_t *)(EthHandle.stcRxFrame).u32Buf; if (len > 0UL) { /* Allocate a pbuf chain of pbufs from the buffer */ - p = (struct pbuf *)malloc(sizeof(struct pbuf) + len); - if (NULL != p) { - p->next = NULL; - p->payload = &((uint8_t *)p)[sizeof(struct pbuf)]; - p->len = len; - (void)memset(p->payload, 0, p->len); - } + p = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM); } if (p != NULL) { DmaRxDesc = (EthHandle.stcRxFrame).pstcFSDesc;