DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] rte_sched: correctly free allocated subport memory
@ 2020-05-26 17:24 Hrvoje Habjanic
  2020-05-27 11:48 ` Singh, Jasvinder
  2020-05-29  5:48 ` Stephen Hemminger
  0 siblings, 2 replies; 5+ messages in thread
From: Hrvoje Habjanic @ 2020-05-26 17:24 UTC (permalink / raw)
  To: dev

In function rte_sched_subport_free (lib/librte_sched/rte_sched.c,
line 865), there is code to free all allocated stuff related to
scheduler subport. First there are some checks, and in the end,
rte_bitmap_free is called.

Now, rte_bitmap_free is a dummy function, and it just checks if
provided pointer to bitmap is valid or not. So, actual memory for
subport is not freed.

This patch fixes this by removing call to rte_bitmap_free, and
instead calling rte_free.

Signed-off-by: Hrvoje Habjanic <hrvoje.habjanic@zg.ht.hr>
---
 lib/librte_sched/rte_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
index c0983ddda..f15a3b515 100644
--- a/lib/librte_sched/rte_sched.c
+++ b/lib/librte_sched/rte_sched.c
@@ -888,7 +888,7 @@ rte_sched_subport_free(struct rte_sched_port *port,
 		}
 	}
 
-	rte_bitmap_free(subport->bmp);
+	rte_free(subport);
 }
 
 void
-- 
2.17.1


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

end of thread, other threads:[~2020-06-24 22:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 17:24 [dpdk-dev] [PATCH] rte_sched: correctly free allocated subport memory Hrvoje Habjanic
2020-05-27 11:48 ` Singh, Jasvinder
2020-05-30  8:05   ` Hrvoje Habjanic
2020-06-24 22:47     ` Thomas Monjalon
2020-05-29  5:48 ` Stephen Hemminger

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git