From 4c9fbc9467e3da0c9366f2591be6ef8079b88f11 Mon Sep 17 00:00:00 2001 From: Koichi Imai <45482193+Koichi98@users.noreply.github.com> Date: Fri, 31 Jan 2025 18:47:29 +0900 Subject: [PATCH] fix: delete sub_info in remove_all_topics (#344) delete sub_info in remove_all_topics Signed-off-by: Koichi Imai --- kmod/agnocast.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kmod/agnocast.c b/kmod/agnocast.c index 4df32bd1..18be4b07 100644 --- a/kmod/agnocast.c +++ b/kmod/agnocast.c @@ -1696,6 +1696,15 @@ static void remove_all_topics(void) kfree(pub_info); } + struct subscriber_info * sub_info; + int bkt_sub_info; + struct hlist_node * tmp_sub_info; + hash_for_each_safe(wrapper->topic.sub_info_htable, bkt_sub_info, tmp_sub_info, sub_info, node) + { + hash_del(&sub_info->node); + kfree(sub_info); + } + hash_del(&wrapper->node); kfree(wrapper->key); kfree(wrapper);