genl: Hold reference on correct module while netlink-dump.
netlink dump operations take module as parameter to hold reference for entire netlink dump duration. Currently it holds ref only on genl module which is not correct when we use ops registered to genl from another module. Following patch adds module pointer to genl_ops so that netlink can hold ref count on it. CC: Jesse Gross <jesse@nicira.com> CC: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
9b96309c5b
commit
33c6b1f6b1
@@ -61,6 +61,7 @@ struct genl_family {
|
||||
struct list_head ops_list; /* private */
|
||||
struct list_head family_list; /* private */
|
||||
struct list_head mcast_groups; /* private */
|
||||
struct module *module;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -121,9 +122,24 @@ struct genl_ops {
|
||||
struct list_head ops_list;
|
||||
};
|
||||
|
||||
extern int genl_register_family(struct genl_family *family);
|
||||
extern int genl_register_family_with_ops(struct genl_family *family,
|
||||
extern int __genl_register_family(struct genl_family *family);
|
||||
|
||||
static inline int genl_register_family(struct genl_family *family)
|
||||
{
|
||||
family->module = THIS_MODULE;
|
||||
return __genl_register_family(family);
|
||||
}
|
||||
|
||||
extern int __genl_register_family_with_ops(struct genl_family *family,
|
||||
struct genl_ops *ops, size_t n_ops);
|
||||
|
||||
static inline int genl_register_family_with_ops(struct genl_family *family,
|
||||
struct genl_ops *ops, size_t n_ops)
|
||||
{
|
||||
family->module = THIS_MODULE;
|
||||
return __genl_register_family_with_ops(family, ops, n_ops);
|
||||
}
|
||||
|
||||
extern int genl_unregister_family(struct genl_family *family);
|
||||
extern int genl_register_ops(struct genl_family *, struct genl_ops *ops);
|
||||
extern int genl_unregister_ops(struct genl_family *, struct genl_ops *ops);
|
||||
|
Reference in New Issue
Block a user