aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMichal Miroslaw <mirq-linux@rere.qmqm.pl>2007-03-13 16:45:26 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2007-03-23 12:49:22 -0700
commitd684641802ada3ac1b4aef27314ec960c81abd80 (patch)
treebd644f86042f1dae3d0b487d4e7de4a7b3c83d87 /net
parent0065572ae6662a3b53fa4f8beb4feab61114590c (diff)
NETFILTER: nfnetlink_log: fix reference counting
[NETFILTER]: nfnetlink_log: fix reference counting Fix reference counting (memory leak) problem in __nfulnl_send() and callers related to packet queueing. Signed-off-by: Michal Miroslaw <mirq-linux@rere.qmqm.pl> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nfnetlink_log.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 690b173bdee..f7eafd80474 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -218,10 +218,8 @@ _instance_destroy2(struct nfulnl_instance *inst, int lock)
spin_lock_bh(&inst->lock);
if (inst->skb) {
/* timer "holds" one reference (we have one more) */
- if (timer_pending(&inst->timer)) {
- del_timer(&inst->timer);
+ if (del_timer(&inst->timer))
instance_put(inst);
- }
if (inst->qlen)
__nfulnl_send(inst);
if (inst->skb) {
@@ -695,10 +693,8 @@ nfulnl_log_packet(unsigned int pf,
UDEBUG("flushing old skb\n");
/* timer "holds" one reference (we have another one) */
- if (timer_pending(&inst->timer)) {
- del_timer(&inst->timer);
+ if (del_timer(&inst->timer))
instance_put(inst);
- }
__nfulnl_send(inst);
if (!(inst->skb = nfulnl_alloc_skb(nlbufsiz, size))) {