aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Liden <per.liden@ericsson.com>2006-01-13 16:06:40 -0500
committerDavid S. Miller <davem@davemloft.net>2006-01-13 16:06:40 -0500
commit23b0ca5bf52cef0ab0f0fe247cb91cbef836e7eb (patch)
tree3643a547de2c6f3bad63361d1584ff566c9012ba
parent2e4e6a17af35be359cc8f1c924f8f198fbd478cc (diff)
[PATCH] genetlink: don't touch module ref count
Increasing the module ref count at registration will block the module from ever being unloaded. In fact, genetlink should not care about the owner at all. This patch removes the owner field from the struct registered with genetlink. Signed-off-by: Per Liden <per.liden@ericsson.com> Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/genetlink.h1
-rw-r--r--net/netlink/genetlink.c7
-rw-r--r--net/tipc/netlink.c1
3 files changed, 0 insertions, 9 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index c5b96b2b8155..805de50df00d 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -22,7 +22,6 @@ struct genl_family
22 char name[GENL_NAMSIZ]; 22 char name[GENL_NAMSIZ];
23 unsigned int version; 23 unsigned int version;
24 unsigned int maxattr; 24 unsigned int maxattr;
25 struct module * owner;
26 struct nlattr ** attrbuf; /* private */ 25 struct nlattr ** attrbuf; /* private */
27 struct list_head ops_list; /* private */ 26 struct list_head ops_list; /* private */
28 struct list_head family_list; /* private */ 27 struct list_head family_list; /* private */
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 3b1378498d50..4ae1538c54a9 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -222,11 +222,6 @@ int genl_register_family(struct genl_family *family)
222 goto errout_locked; 222 goto errout_locked;
223 } 223 }
224 224
225 if (!try_module_get(family->owner)) {
226 err = -EBUSY;
227 goto errout_locked;
228 }
229
230 if (family->id == GENL_ID_GENERATE) { 225 if (family->id == GENL_ID_GENERATE) {
231 u16 newid = genl_generate_id(); 226 u16 newid = genl_generate_id();
232 227
@@ -283,7 +278,6 @@ int genl_unregister_family(struct genl_family *family)
283 INIT_LIST_HEAD(&family->ops_list); 278 INIT_LIST_HEAD(&family->ops_list);
284 genl_unlock(); 279 genl_unlock();
285 280
286 module_put(family->owner);
287 kfree(family->attrbuf); 281 kfree(family->attrbuf);
288 genl_ctrl_event(CTRL_CMD_DELFAMILY, family); 282 genl_ctrl_event(CTRL_CMD_DELFAMILY, family);
289 return 0; 283 return 0;
@@ -535,7 +529,6 @@ static struct genl_family genl_ctrl = {
535 .name = "nlctrl", 529 .name = "nlctrl",
536 .version = 0x1, 530 .version = 0x1,
537 .maxattr = CTRL_ATTR_MAX, 531 .maxattr = CTRL_ATTR_MAX,
538 .owner = THIS_MODULE,
539}; 532};
540 533
541static int __init genl_init(void) 534static int __init genl_init(void)
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c
index 6fe95acde4fa..19b3f4022532 100644
--- a/net/tipc/netlink.c
+++ b/net/tipc/netlink.c
@@ -72,7 +72,6 @@ static struct genl_family family = {
72 .version = TIPC_GENL_VERSION, 72 .version = TIPC_GENL_VERSION,
73 .hdrsize = TIPC_GENL_HDRLEN, 73 .hdrsize = TIPC_GENL_HDRLEN,
74 .maxattr = 0, 74 .maxattr = 0,
75 .owner = THIS_MODULE,
76}; 75};
77 76
78static struct genl_ops ops = { 77static struct genl_ops ops = {