Commit d6846418 authored by Michal Miroslaw's avatar Michal Miroslaw Committed by Greg Kroah-Hartman

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: default avatarMichal Miroslaw <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0065572a
......@@ -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))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment