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

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

[NETFILTER]: nf_log: use rcu_assign_pointer for RCU protected pointer



Also replace synchronize_net() calls by synchronize_rcu() since the
RCU protected data is also used for sysfs.

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fd706d69
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -46,11 +46,11 @@ int nf_log_unregister_pf(int pf)
		return -EINVAL;

	spin_lock(&nf_log_lock);
	nf_logging[pf] = NULL;
	rcu_assign_pointer(nf_logging[pf], NULL);
	spin_unlock(&nf_log_lock);

	/* Give time to concurrent readers. */
	synchronize_net();
	synchronize_rcu();

	return 0;
}
@@ -63,11 +63,11 @@ void nf_log_unregister_logger(struct nf_logger *logger)
	spin_lock(&nf_log_lock);
	for (i = 0; i < NPROTO; i++) {
		if (nf_logging[i] == logger)
			nf_logging[i] = NULL;
			rcu_assign_pointer(nf_logging[i], NULL);
	}
	spin_unlock(&nf_log_lock);

	synchronize_net();
	synchronize_rcu();
}
EXPORT_SYMBOL(nf_log_unregister_logger);