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

Commit 7d90e86d authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NETFILTER]: nfnetlink_log: fix module reference counting



Count module references correctly: after instance_destroy() there
might be timer pending and holding a reference for this netlink instance.

Based on patch by Michal 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 dd16704e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ instance_put(struct nfulnl_instance *inst)
	if (inst && atomic_dec_and_test(&inst->use)) {
		UDEBUG("kfree(inst=%p)\n", inst);
		kfree(inst);
		module_put(THIS_MODULE);
	}
}

@@ -228,8 +229,6 @@ _instance_destroy2(struct nfulnl_instance *inst, int lock)

	/* and finally put the refcount */
	instance_put(inst);

	module_put(THIS_MODULE);
}

static inline void