[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>

authored by Per Liden and committed by David S. Miller 23b0ca5b 2e4e6a17

-9
-1
include/net/genetlink.h
··· 22 char name[GENL_NAMSIZ]; 23 unsigned int version; 24 unsigned int maxattr; 25 - struct module * owner; 26 struct nlattr ** attrbuf; /* private */ 27 struct list_head ops_list; /* private */ 28 struct list_head family_list; /* private */
··· 22 char name[GENL_NAMSIZ]; 23 unsigned int version; 24 unsigned int maxattr; 25 struct nlattr ** attrbuf; /* private */ 26 struct list_head ops_list; /* private */ 27 struct list_head family_list; /* private */
-7
net/netlink/genetlink.c
··· 222 goto errout_locked; 223 } 224 225 - if (!try_module_get(family->owner)) { 226 - err = -EBUSY; 227 - goto errout_locked; 228 - } 229 - 230 if (family->id == GENL_ID_GENERATE) { 231 u16 newid = genl_generate_id(); 232 ··· 278 INIT_LIST_HEAD(&family->ops_list); 279 genl_unlock(); 280 281 - module_put(family->owner); 282 kfree(family->attrbuf); 283 genl_ctrl_event(CTRL_CMD_DELFAMILY, family); 284 return 0; ··· 529 .name = "nlctrl", 530 .version = 0x1, 531 .maxattr = CTRL_ATTR_MAX, 532 - .owner = THIS_MODULE, 533 }; 534 535 static int __init genl_init(void)
··· 222 goto errout_locked; 223 } 224 225 if (family->id == GENL_ID_GENERATE) { 226 u16 newid = genl_generate_id(); 227 ··· 283 INIT_LIST_HEAD(&family->ops_list); 284 genl_unlock(); 285 286 kfree(family->attrbuf); 287 genl_ctrl_event(CTRL_CMD_DELFAMILY, family); 288 return 0; ··· 535 .name = "nlctrl", 536 .version = 0x1, 537 .maxattr = CTRL_ATTR_MAX, 538 }; 539 540 static int __init genl_init(void)
-1
net/tipc/netlink.c
··· 72 .version = TIPC_GENL_VERSION, 73 .hdrsize = TIPC_GENL_HDRLEN, 74 .maxattr = 0, 75 - .owner = THIS_MODULE, 76 }; 77 78 static struct genl_ops ops = {
··· 72 .version = TIPC_GENL_VERSION, 73 .hdrsize = TIPC_GENL_HDRLEN, 74 .maxattr = 0, 75 }; 76 77 static struct genl_ops ops = {