From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Subject: [NETFILTER 04/10]: nfnetlink_log: fix reference leak Date: Sun, 4 Mar 2007 21:20:03 +0100 (MET) Message-ID: <20070304201911.28582.87382.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 reference leak Stop reference leaking in nfulnl_log_packet(). If we start a timer we are already taking another reference. Signed-off-by: Michal Miroslaw Signed-off-by: Patrick McHardy --- commit d8b913269b678945a6af2e5432b6c2aa8a6ff3ef tree 626a8ad2f8a035b327fe7f1c779a3146283eb72b parent efe99d89bb32f8ea7f76fdf9867d0df52e8ca0aa author Michal Miroslaw Thu, 01 Mar 2007 16:18:44 +0100 committer Patrick McHardy Thu, 01 Mar 2007 16:18:44 +0100 net/netfilter/nfnetlink_log.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index b8eab0d..62c3f31 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c @@ -711,15 +711,16 @@ #endif inst->timer.expires = jiffies + (inst->flushtimeout*HZ/100); add_timer(&inst->timer); } - spin_unlock_bh(&inst->lock); +unlock_and_release: + spin_unlock_bh(&inst->lock); + instance_put(inst); return; alloc_failure: - spin_unlock_bh(&inst->lock); - instance_put(inst); UDEBUG("error allocating skb\n"); /* FIXME: statistics */ + goto unlock_and_release; } static int