forked from Minki/linux
xfrm: change the type of xfrm_register_km and xfrm_unregister_km
Functions xfrm_register_km and xfrm_unregister_km do always return 0, change the type of functions to void. Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
parent
924b290655
commit
f41b284a2c
@ -583,8 +583,8 @@ struct xfrm_mgr {
|
||||
bool (*is_alive)(const struct km_event *c);
|
||||
};
|
||||
|
||||
int xfrm_register_km(struct xfrm_mgr *km);
|
||||
int xfrm_unregister_km(struct xfrm_mgr *km);
|
||||
void xfrm_register_km(struct xfrm_mgr *km);
|
||||
void xfrm_unregister_km(struct xfrm_mgr *km);
|
||||
|
||||
struct xfrm_tunnel_skb_cb {
|
||||
union {
|
||||
|
@ -3894,14 +3894,10 @@ static int __init ipsec_pfkey_init(void)
|
||||
err = sock_register(&pfkey_family_ops);
|
||||
if (err != 0)
|
||||
goto out_unregister_pernet;
|
||||
err = xfrm_register_km(&pfkeyv2_mgr);
|
||||
if (err != 0)
|
||||
goto out_sock_unregister;
|
||||
xfrm_register_km(&pfkeyv2_mgr);
|
||||
out:
|
||||
return err;
|
||||
|
||||
out_sock_unregister:
|
||||
sock_unregister(PF_KEY);
|
||||
out_unregister_pernet:
|
||||
unregister_pernet_subsys(&pfkey_net_ops);
|
||||
out_unregister_key_proto:
|
||||
|
@ -2481,22 +2481,20 @@ EXPORT_SYMBOL(xfrm_user_policy);
|
||||
|
||||
static DEFINE_SPINLOCK(xfrm_km_lock);
|
||||
|
||||
int xfrm_register_km(struct xfrm_mgr *km)
|
||||
void xfrm_register_km(struct xfrm_mgr *km)
|
||||
{
|
||||
spin_lock_bh(&xfrm_km_lock);
|
||||
list_add_tail_rcu(&km->list, &xfrm_km_list);
|
||||
spin_unlock_bh(&xfrm_km_lock);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(xfrm_register_km);
|
||||
|
||||
int xfrm_unregister_km(struct xfrm_mgr *km)
|
||||
void xfrm_unregister_km(struct xfrm_mgr *km)
|
||||
{
|
||||
spin_lock_bh(&xfrm_km_lock);
|
||||
list_del_rcu(&km->list);
|
||||
spin_unlock_bh(&xfrm_km_lock);
|
||||
synchronize_rcu();
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(xfrm_unregister_km);
|
||||
|
||||
|
@ -3633,10 +3633,8 @@ static int __init xfrm_user_init(void)
|
||||
rv = register_pernet_subsys(&xfrm_user_net_ops);
|
||||
if (rv < 0)
|
||||
return rv;
|
||||
rv = xfrm_register_km(&netlink_mgr);
|
||||
if (rv < 0)
|
||||
unregister_pernet_subsys(&xfrm_user_net_ops);
|
||||
return rv;
|
||||
xfrm_register_km(&netlink_mgr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit xfrm_user_exit(void)
|
||||
|
Loading…
Reference in New Issue
Block a user