[NETFILTER]: nf_log: make nf_log_unregister_pf return void
Since the only user of nf_log_unregister_pf (nfnetlink_log) doesn't check the return value, change it to void and bail out silently when a non-existant address family is supplied. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a5ea6169f2
commit
9dc6aa5fcf
|
@ -172,7 +172,7 @@ struct nf_logger {
|
||||||
|
|
||||||
/* Function to register/unregister log function. */
|
/* Function to register/unregister log function. */
|
||||||
int nf_log_register(int pf, struct nf_logger *logger);
|
int nf_log_register(int pf, struct nf_logger *logger);
|
||||||
int nf_log_unregister_pf(int pf);
|
void nf_log_unregister_pf(int pf);
|
||||||
void nf_log_unregister_logger(struct nf_logger *logger);
|
void nf_log_unregister_logger(struct nf_logger *logger);
|
||||||
|
|
||||||
/* Calls the registered backend logging function */
|
/* Calls the registered backend logging function */
|
||||||
|
|
|
@ -40,19 +40,16 @@ int nf_log_register(int pf, struct nf_logger *logger)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(nf_log_register);
|
EXPORT_SYMBOL(nf_log_register);
|
||||||
|
|
||||||
int nf_log_unregister_pf(int pf)
|
void nf_log_unregister_pf(int pf)
|
||||||
{
|
{
|
||||||
if (pf >= NPROTO)
|
if (pf >= NPROTO)
|
||||||
return -EINVAL;
|
return;
|
||||||
|
|
||||||
spin_lock(&nf_log_lock);
|
spin_lock(&nf_log_lock);
|
||||||
rcu_assign_pointer(nf_logging[pf], NULL);
|
rcu_assign_pointer(nf_logging[pf], NULL);
|
||||||
spin_unlock(&nf_log_lock);
|
spin_unlock(&nf_log_lock);
|
||||||
|
|
||||||
/* Give time to concurrent readers. */
|
/* Give time to concurrent readers. */
|
||||||
synchronize_rcu();
|
synchronize_rcu();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(nf_log_unregister_pf);
|
EXPORT_SYMBOL(nf_log_unregister_pf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue