Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed32abea authored by Michal Miroslaw's avatar Michal Miroslaw Committed by David S. Miller
Browse files

[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: default avatarMichal Miroslaw <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d3ab4298
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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