aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2014-12-02 02:00:25 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-08 20:39:56 -0500
commit38622f41956f92a06f5b5e42e50746851110d970 (patch)
treefda4efa237bd3481270aabae6a7bfee7bffdcf93 /net/tipc
parent993bfe5daf34c645a51348facdc7c28c55f488fe (diff)
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: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Tested-by: Erik Hugne <erik.hugne@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/name_table.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index df3da2924fc7..ba0ee3e8b623 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -964,10 +964,6 @@ static void tipc_purge_publications(struct name_seq *seq)
964 struct sub_seq *sseq; 964 struct sub_seq *sseq;
965 struct name_info *info; 965 struct name_info *info;
966 966
967 if (!seq->sseqs) {
968 nameseq_delete_empty(seq);
969 return;
970 }
971 sseq = seq->sseqs; 967 sseq = seq->sseqs;
972 info = sseq->info; 968 info = sseq->info;
973 list_for_each_entry_safe(publ, safe, &info->zone_list, zone_list) { 969 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 publ->ref, publ->key); 971 publ->ref, publ->key);
976 kfree(publ); 972 kfree(publ);
977 } 973 }
974 hlist_del_init(&seq->ns_list);
975 kfree(seq->sseqs);
976 kfree(seq);
978} 977}
979 978
980void tipc_nametbl_stop(void) 979void tipc_nametbl_stop(void)