tipc: fix memory leak during module removal
authorErik Hugne <erik.hugne@ericsson.com>
Thu, 6 Mar 2014 13:40:20 +0000 (14:40 +0100)
committerJiri Slaby <jslaby@suse.cz>
Fri, 18 Apr 2014 09:06:56 +0000 (11:06 +0200)
commit140490bca84bceb627da429ffceb03fb88b208e3
tree002b27cd4f118c02065a8e54b7de62ce3a9aa308
parentfa7a24eeb7d49ea81028b1ddb0921a6703fe1424
tipc: fix memory leak during module removal

[ Upstream commit 1bb8dce57f4d15233688c68990852a10eb1cd79f ]

When the TIPC module is removed, the tasklet handler is disabled
before all other subsystems. This will cause lingering publications
in the name table because the node_down tasklets responsible to
clean up publications from an unreachable node will never run.
When the name table is shut down, these publications are detected
and an error message is logged:
tipc: nametbl_stop(): orphaned hash chain detected
This is actually a memory leak, introduced with commit
993b858e37b3120ee76d9957a901cca22312ffaa ("tipc: correct the order
of stopping services at rmmod")

Instead of just logging an error and leaking memory, we free
the orphaned entries during nametable shutdown.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
net/tipc/name_table.c