[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 Signed-off-by: Patrick McHardy --- commit 3ed110cfb9e71fa5f6c44720f20a8e705e9bad0c tree 607c19476244b034aaf8c0da12f04349cd48bf90 parent 43ff9c5b97da4d085ddf5e37a12a25ed74c14d5a author Michal Miroslaw Tue, 13 Mar 2007 16:41:58 +0100 committer Patrick McHardy Tue, 13 Mar 2007 16:41:58 +0100 net/netfilter/nfnetlink_log.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index 690b173..f7eafd8 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c @@ -218,10 +218,8 @@ _instance_destroy2(struct nfulnl_instanc 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 @@ #endif 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))) {