From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Subject: [NETFILTER 08/10]: nfnetlink_log: fix module reference counting Date: Sun, 4 Mar 2007 21:20:08 +0100 (MET) Message-ID: <20070304201916.28582.84106.sendpatchset@localhost.localdomain> References: <20070304201906.28582.51903.sendpatchset@localhost.localdomain> Cc: netfilter-devel@lists.netfilter.org, Patrick McHardy To: davem@davemloft.net Return-path: In-Reply-To: <20070304201906.28582.51903.sendpatchset@localhost.localdomain> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-devel-bounces@lists.netfilter.org Errors-To: netfilter-devel-bounces@lists.netfilter.org List-Id: netfilter-devel.vger.kernel.org [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 Signed-off-by: Patrick McHardy --- commit 3aed666579e96dfe23eb1988faf4af09c33358bc tree ebfeba440d7599dea20c6a35a4a6d840dfe06ff3 parent 79fb63ea8565212c9e8fde1e18a5598b438ced08 author Patrick McHardy Fri, 02 Mar 2007 13:21:31 +0100 committer Patrick McHardy Fri, 02 Mar 2007 13:21:31 +0100 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 b669db5..d0af8bc 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c @@ -133,6 +133,7 @@ instance_put(struct nfulnl_instance *ins if (inst && atomic_dec_and_test(&inst->use)) { UDEBUG("kfree(inst=%p)\n", inst); kfree(inst); + module_put(THIS_MODULE); } } @@ -228,8 +229,6 @@ _instance_destroy2(struct nfulnl_instanc /* and finally put the refcount */ instance_put(inst); - - module_put(THIS_MODULE); } static inline void