Commit 38622f41 authored by Ying Xue's avatar Ying Xue Committed by David S. Miller

tipc: ensure all name sequences are released when name table is stopped

As TIPC subscriber server is terminated before name table, no user
depends on subscription list of name sequence when name table is
stopped. Therefore, all name sequences stored in name table should
be released whatever their subscriptions lists are empty or not,
otherwise, memory leak might happen.
Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Tested-by: default avatarErik Hugne <erik.hugne@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 993bfe5d
...@@ -964,10 +964,6 @@ static void tipc_purge_publications(struct name_seq *seq) ...@@ -964,10 +964,6 @@ static void tipc_purge_publications(struct name_seq *seq)
struct sub_seq *sseq; struct sub_seq *sseq;
struct name_info *info; struct name_info *info;
if (!seq->sseqs) {
nameseq_delete_empty(seq);
return;
}
sseq = seq->sseqs; sseq = seq->sseqs;
info = sseq->info; info = sseq->info;
list_for_each_entry_safe(publ, safe, &info->zone_list, zone_list) { list_for_each_entry_safe(publ, safe, &info->zone_list, zone_list) {
...@@ -975,6 +971,9 @@ static void tipc_purge_publications(struct name_seq *seq) ...@@ -975,6 +971,9 @@ static void tipc_purge_publications(struct name_seq *seq)
publ->ref, publ->key); publ->ref, publ->key);
kfree(publ); kfree(publ);
} }
hlist_del_init(&seq->ns_list);
kfree(seq->sseqs);
kfree(seq);
} }
void tipc_nametbl_stop(void) void tipc_nametbl_stop(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment