diff options
author | Patrick McHardy <kaber@trash.net> | 2007-03-04 18:59:45 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-03-05 16:25:25 -0500 |
commit | 7d90e86d31e8beeb66d6754aece890ac4a579887 (patch) | |
tree | 8f921e7250fd1e6d9abde9ab48d36164661f97bd /net | |
parent | dd16704eba171b32ef0cded3a4f562b33b911066 (diff) |
[NETFILTER]: nfnetlink_log: fix module reference counting
Count module references correctly: after instance_destroy() there
might be timer pending and holding a reference for this netlink instance.
Based on patch by Michal Miroslaw <mirq-linux@rere.qmqm.pl>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nfnetlink_log.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index b669db564695..d0af8bc3eee1 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
@@ -133,6 +133,7 @@ instance_put(struct nfulnl_instance *inst) | |||
133 | if (inst && atomic_dec_and_test(&inst->use)) { | 133 | if (inst && atomic_dec_and_test(&inst->use)) { |
134 | UDEBUG("kfree(inst=%p)\n", inst); | 134 | UDEBUG("kfree(inst=%p)\n", inst); |
135 | kfree(inst); | 135 | kfree(inst); |
136 | module_put(THIS_MODULE); | ||
136 | } | 137 | } |
137 | } | 138 | } |
138 | 139 | ||
@@ -228,8 +229,6 @@ _instance_destroy2(struct nfulnl_instance *inst, int lock) | |||
228 | 229 | ||
229 | /* and finally put the refcount */ | 230 | /* and finally put the refcount */ |
230 | instance_put(inst); | 231 | instance_put(inst); |
231 | |||
232 | module_put(THIS_MODULE); | ||
233 | } | 232 | } |
234 | 233 | ||
235 | static inline void | 234 | static inline void |