Commit 23b0ca5b authored by Per Liden's avatar Per Liden Committed by David S. Miller

[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: default avatarPer Liden <per.liden@ericsson.com>
Signed-off-by: default avatarJamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2e4e6a17
...@@ -22,7 +22,6 @@ struct genl_family ...@@ -22,7 +22,6 @@ struct genl_family
char name[GENL_NAMSIZ]; char name[GENL_NAMSIZ];
unsigned int version; unsigned int version;
unsigned int maxattr; unsigned int maxattr;
struct module * owner;
struct nlattr ** attrbuf; /* private */ struct nlattr ** attrbuf; /* private */
struct list_head ops_list; /* private */ struct list_head ops_list; /* private */
struct list_head family_list; /* private */ struct list_head family_list; /* private */
......
...@@ -222,11 +222,6 @@ int genl_register_family(struct genl_family *family) ...@@ -222,11 +222,6 @@ int genl_register_family(struct genl_family *family)
goto errout_locked; goto errout_locked;
} }
if (!try_module_get(family->owner)) {
err = -EBUSY;
goto errout_locked;
}
if (family->id == GENL_ID_GENERATE) { if (family->id == GENL_ID_GENERATE) {
u16 newid = genl_generate_id(); u16 newid = genl_generate_id();
...@@ -283,7 +278,6 @@ int genl_unregister_family(struct genl_family *family) ...@@ -283,7 +278,6 @@ int genl_unregister_family(struct genl_family *family)
INIT_LIST_HEAD(&family->ops_list); INIT_LIST_HEAD(&family->ops_list);
genl_unlock(); genl_unlock();
module_put(family->owner);
kfree(family->attrbuf); kfree(family->attrbuf);
genl_ctrl_event(CTRL_CMD_DELFAMILY, family); genl_ctrl_event(CTRL_CMD_DELFAMILY, family);
return 0; return 0;
...@@ -535,7 +529,6 @@ static struct genl_family genl_ctrl = { ...@@ -535,7 +529,6 @@ static struct genl_family genl_ctrl = {
.name = "nlctrl", .name = "nlctrl",
.version = 0x1, .version = 0x1,
.maxattr = CTRL_ATTR_MAX, .maxattr = CTRL_ATTR_MAX,
.owner = THIS_MODULE,
}; };
static int __init genl_init(void) static int __init genl_init(void)
......
...@@ -72,7 +72,6 @@ static struct genl_family family = { ...@@ -72,7 +72,6 @@ static struct genl_family family = {
.version = TIPC_GENL_VERSION, .version = TIPC_GENL_VERSION,
.hdrsize = TIPC_GENL_HDRLEN, .hdrsize = TIPC_GENL_HDRLEN,
.maxattr = 0, .maxattr = 0,
.owner = THIS_MODULE,
}; };
static struct genl_ops ops = { static struct genl_ops ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment