summaryrefslogtreecommitdiff
path: root/net/qrtr/qrtr.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2017-12-02 23:44:07 +0300
committerDavid S. Miller <davem@davemloft.net>2017-12-04 19:32:39 +0300
commitc1c502b511503ee5de55382744859b622411f32b (patch)
treeb31562756414fd0d71b934e232e91a62bfb59e33 /net/qrtr/qrtr.c
parente4202511480da5f8e6870d8f6ecbb821aeaa8caf (diff)
downloadlinux-c1c502b511503ee5de55382744859b622411f32b.tar.xz
net: use rtnl_register_module where needed
all of these can be compiled as a module, so use new _module version to make sure module can no longer be removed while callback/dump is in use. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/qrtr/qrtr.c')
-rw-r--r--net/qrtr/qrtr.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
index 77ab05e23001..5fb3929e3d7d 100644
--- a/net/qrtr/qrtr.c
+++ b/net/qrtr/qrtr.c
@@ -1116,9 +1116,13 @@ static int __init qrtr_proto_init(void)
return rc;
}
- rtnl_register(PF_QIPCRTR, RTM_NEWADDR, qrtr_addr_doit, NULL, 0);
+ rc = rtnl_register_module(THIS_MODULE, PF_QIPCRTR, RTM_NEWADDR, qrtr_addr_doit, NULL, 0);
+ if (rc) {
+ sock_unregister(qrtr_family.family);
+ proto_unregister(&qrtr_proto);
+ }
- return 0;
+ return rc;
}
postcore_initcall(qrtr_proto_init);