]> Pileus Git - ~andy/linux/commit
tipc: make bearer set up in module insertion stage
authorYing Xue <ying.xue@windriver.com>
Thu, 20 Feb 2014 03:32:50 +0000 (11:32 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 22 Feb 2014 05:00:15 +0000 (00:00 -0500)
commit970122fdf4b2d79c708022f2fdc0ab3840311d87
treef79e78be18af6890b71aa833161b6ca4cc4576b3
parent9fe7ed474956944443eec57c5f75be12e10da84e
tipc: make bearer set up in module insertion stage

Accidentally a side effect is involved by commit 6e967adf7(tipc:
relocate common functions from media to bearer). Now tipc stack
handler of receiving packets from netdevices as well as netdevice
notification handler are registered when bearer is enabled rather
than tipc module initialization stage, but the two handlers are
both unregistered in tipc module exit phase. If tipc module is
inserted and then immediately removed, the following warning
message will appear:

"dev_remove_pack: ffffffffa0380940 not found"

This is because in module insertion stage tipc stack packet handler
is not registered at all, but in module exit phase dev_remove_pack()
needs to remove it. Of course, dev_remove_pack() cannot find tipc
protocol handler from the kernel protocol handler list so that the
warning message is printed out.

But if registering the two handlers is adjusted from enabling bearer
phase into inserting module stage, the warning message will be
eliminated. Due to this change, tipc_core_start_net() and
tipc_core_stop_net() can be deleted as well.

Reported-by: Wang Weidong <wangweidong1@huawei.com>
Cc: Jon Maloy <jon.maloy@ericsson.com>
Cc: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/bearer.c
net/tipc/config.c
net/tipc/core.c
net/tipc/core.h