mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
[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>
This commit is contained in:
parent
dd16704eba
commit
7d90e86d31
1 changed files with 1 additions and 2 deletions
|
@ -133,6 +133,7 @@ instance_put(struct nfulnl_instance *inst)
|
||||||
if (inst && atomic_dec_and_test(&inst->use)) {
|
if (inst && atomic_dec_and_test(&inst->use)) {
|
||||||
UDEBUG("kfree(inst=%p)\n", inst);
|
UDEBUG("kfree(inst=%p)\n", inst);
|
||||||
kfree(inst);
|
kfree(inst);
|
||||||
|
module_put(THIS_MODULE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,8 +229,6 @@ _instance_destroy2(struct nfulnl_instance *inst, int lock)
|
||||||
|
|
||||||
/* and finally put the refcount */
|
/* and finally put the refcount */
|
||||||
instance_put(inst);
|
instance_put(inst);
|
||||||
|
|
||||||
module_put(THIS_MODULE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
|
Loading…
Reference in a new issue