diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2007-03-24 21:34:37 +0100 |
---|---|---|
committer | Adrian Bunk <bunk@stusta.de> | 2007-03-24 21:34:37 +0100 |
commit | 3c927506670aabede5d65e0085384d9108d8d96d (patch) | |
tree | d76af6e0e5682da45511a227ff833085d2e06907 | |
parent | 4ed30ae44614fce21c5917fda7c513990915f363 (diff) | |
download | kernel-common-3c927506670aabede5d65e0085384d9108d8d96d.tar.gz kernel-common-3c927506670aabede5d65e0085384d9108d8d96d.tar.bz2 kernel-common-3c927506670aabede5d65e0085384d9108d8d96d.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: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
-rw-r--r-- | 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 616cb7412b6f..c0a3ca64b9c9 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 |