summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMichal Miroslaw <mirq-linux@rere.qmqm.pl>2007-03-04 15:58:15 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2007-03-05 13:25:21 -0800
commited32abeaf3a3da79b63af6a75f0bd0aa7e7eed9e (patch)
tree9fe8dab9db6b1dc2ddebd508cddade025de25138 /net
parentd3ab4298aa136d07219664d563d8decf0e75693f (diff)
downloadlinux-ed32abeaf3a3da79b63af6a75f0bd0aa7e7eed9e.tar.gz
linux-ed32abeaf3a3da79b63af6a75f0bd0aa7e7eed9e.tar.bz2
linux-ed32abeaf3a3da79b63af6a75f0bd0aa7e7eed9e.zip
[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 <mirq-linux@rere.qmqm.pl> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nfnetlink_log.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index b8eab0dbc3dd..62c3f31cdb97 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -711,15 +711,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