diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-04-04 20:39:52 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-04-05 11:54:26 +0200 |
commit | 006fd6e86707319b5f495424eb2c659a123311cb (patch) | |
tree | 344c61b3d7f283932420951438fa10cc7ded5041 | |
parent | aa03dc194997eabf157118b76b0ab5ef88a9faff (diff) | |
download | barebox-006fd6e86707.tar.gz barebox-006fd6e86707.tar.xz |
net: free packets with net_free_packet
While ultimately the same (net_free_packet == dma_free == free), this
will not necessarily be always the case, so let's use the dedicated
net_free_packet function to free the packets.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240404184001.1532897-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | net/net.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -465,7 +465,7 @@ static struct net_connection *net_new(struct eth_device *edev, IPaddr_t dest, return con; out: - free(con->packet); + net_free_packet(con->packet); free(con); return ERR_PTR(ret); } @@ -510,7 +510,7 @@ struct net_connection *net_icmp_new(IPaddr_t dest, rx_handler_f *handler, void net_unregister(struct net_connection *con) { list_del(&con->list); - free(con->packet); + net_free_packet(con->packet); free(con); } @@ -564,7 +564,7 @@ static int net_answer_arp(struct eth_device *edev, unsigned char *pkt, int len) return 0; memcpy(packet, pkt, ETHER_HDR_SIZE + ARP_HDR_SIZE); ret = eth_send(edev, packet, ETHER_HDR_SIZE + ARP_HDR_SIZE); - free(packet); + net_free_packet(packet); return ret; } @@ -677,7 +677,7 @@ static int ping_reply(struct eth_device *edev, unsigned char *pkt, int len) ret = eth_send(edev, packet, ETHER_HDR_SIZE + len); - free(packet); + net_free_packet(packet); return ret; } |