DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: fix memory leak on removing eth rxtx callback
@ 2018-11-21 13:11 wanlebing
  2018-11-21 14:48 ` Ferruh Yigit
  0 siblings, 1 reply; 5+ messages in thread
From: wanlebing @ 2018-11-21 13:11 UTC (permalink / raw)
  To: dev; +Cc: wanlebing, wanlebing

eth rxtx callback is dynamically allocated using rte_zmalloc()
but not released. Fix it by calling rte_free() to free callback
when removing rxtx callback.

Signed-off-by: wanlebing <wanlebing@didichuxing.com>
Signed-off-by: wanlebing <wanlebing@gmail.com>
---
 lib/librte_ethdev/rte_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 5f858174b..f00311047 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -3926,6 +3926,7 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
 		if (cb == user_cb) {
 			/* Remove the user cb from the callback list. */
 			*prev_cb = cb->next;
+			rte_free(cb);
 			ret = 0;
 			break;
 		}
@@ -3960,6 +3961,7 @@ rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
 		if (cb == user_cb) {
 			/* Remove the user cb from the callback list. */
 			*prev_cb = cb->next;
+			rte_free(cb);
 			ret = 0;
 			break;
 		}
-- 
2.14.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-11-23  9:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-21 13:11 [dpdk-dev] [PATCH] ethdev: fix memory leak on removing eth rxtx callback wanlebing
2018-11-21 14:48 ` Ferruh Yigit
2018-11-22  2:32   ` 万乐冰
2018-11-23  2:25   ` lebing wan
2018-11-23  9:13   ` Ananyev, Konstantin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).