hash: fix memory leak of hash_rcu_cfg

Message ID 20221104095123.487630-1-jun.qiu@jaguarmicro.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series hash: fix memory leak of hash_rcu_cfg |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed

Commit Message

Jun Qiu Nov. 4, 2022, 9:51 a.m. UTC
  The memory of h->hash_rcu_cfg which is allocated in
rte_hash_rcu_qsbr_add was leaked.

Fixes: 769b2de ("hash: implement RCU resources reclamation")
Cc: stable@dpdk.org

Signed-off-by: Jun Qiu <jun.qiu@jaguarmicro.com>
---
 lib/hash/rte_cuckoo_hash.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

David Marchand Nov. 14, 2022, 10:03 a.m. UTC | #1
On Fri, Nov 4, 2022 at 10:52 AM Jun Qiu <jun.qiu@jaguarmicro.com> wrote:
>
> The memory of h->hash_rcu_cfg which is allocated in
> rte_hash_rcu_qsbr_add was leaked.
>
> Fixes: 769b2de ("hash: implement RCU resources reclamation")

Please, use 12 chars format for commit hash, as documented.
git config alias.fixline "log -1 --abbrev=12 --format='Fixes: %h
(\"%s\")%nCc: %ae'"

> Cc: stable@dpdk.org
>
> Signed-off-by: Jun Qiu <jun.qiu@jaguarmicro.com>

Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.
  

Patch

diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index 62c762439a..829b79c89a 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -521,6 +521,7 @@  rte_hash_free(struct rte_hash *h)
 	rte_free(h->buckets_ext);
 	rte_free(h->tbl_chng_cnt);
 	rte_free(h->ext_bkt_to_free);
+	rte_free(h->hash_rcu_cfg);
 	rte_free(h);
 	rte_free(te);
 }