Commit 7d90e86d31e8beeb66d6754aece890ac4a579887

Authored by Patrick McHardy
Committed by David S. Miller
1 parent dd16704eba

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

Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff

net/netfilter/nfnetlink_log.c
... ... @@ -133,6 +133,7 @@
133 133 if (inst && atomic_dec_and_test(&inst->use)) {
134 134 UDEBUG("kfree(inst=%p)\n", inst);
135 135 kfree(inst);
  136 + module_put(THIS_MODULE);
136 137 }
137 138 }
138 139  
... ... @@ -228,8 +229,6 @@
228 229  
229 230 /* and finally put the refcount */
230 231 instance_put(inst);
231   -
232   - module_put(THIS_MODULE);
233 232 }
234 233  
235 234 static inline void