From: Michał Mirosław Date: Sat, 24 Mar 2007 20:34:37 +0000 (+0100) Subject: [NETFILTER]: nfnetlink_log: fix reference leak X-Git-Tag: v2.6.16.45-rc1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c927506670aabede5d65e0085384d9108d8d96d;p=thirdparty%2Fkernel%2Fstable.git [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: Michał Mirosław Signed-off-by: Patrick McHardy Signed-off-by: Adrian Bunk --- diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index 616cb7412b6fd..c0a3ca64b9c97 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c @@ -687,15 +687,16 @@ nfulnl_log_packet(unsigned int pf, 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