Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1621b94d authored by Ying Xue's avatar Ying Xue Committed by David S. Miller
Browse files

tipc: fix memory leak of publications



Commit 1bb8dce5 ("tipc: fix memory
leak during module removal") introduced a memory leak issue: when
name table is stopped, it's forgotten that publication instances are
freed properly. Additionally the useless "continue" statement in
tipc_nametbl_stop() is removed as well.

Reported-by: default avatarJason <huzhijiang@gmail.com>
Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
Acked-by: default avatarErik Hugne <erik.hugne@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5c98631c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -969,6 +969,7 @@ static void tipc_purge_publications(struct name_seq *seq)
	list_for_each_entry_safe(publ, safe, &info->zone_list, zone_list) {
		tipc_nametbl_remove_publ(publ->type, publ->lower, publ->node,
					 publ->ref, publ->key);
		kfree(publ);
	}
}

@@ -990,7 +991,6 @@ void tipc_nametbl_stop(void)
		hlist_for_each_entry_safe(seq, safe, seq_head, ns_list) {
			tipc_purge_publications(seq);
		}
		continue;
	}
	kfree(table.types);
	table.types = NULL;