[NETFILTER]: nfnetlink_log: fix reference leak
authorMichal Miroslaw <mirq-linux@rere.qmqm.pl>
Sun, 4 Mar 2007 23:58:15 +0000 (15:58 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 5 Mar 2007 21:25:21 +0000 (13:25 -0800)
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>
net/netfilter/nfnetlink_log.c

index b8eab0dbc3dd3f3a93f6af25317dc1c5e7f2f98b..62c3f31cdb97befb4bf9a3deef8591d2ca36aa89 100644 (file)
@@ -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