diff options
author | Li RongQing <roy.qing.li@gmail.com> | 2015-04-23 06:06:53 +0300 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2015-04-23 12:37:52 +0300 |
commit | f31e8d4f7b44092b6b2ab3a6b1d4079836b6955a (patch) | |
tree | 6b7a2cae68eb6a86819a0ccc3e8f8a3800afb292 /net/xfrm/xfrm_policy.c | |
parent | 800777026eeb33585f29608c2c6131fc66d2e218 (diff) | |
download | linux-f31e8d4f7b44092b6b2ab3a6b1d4079836b6955a.tar.xz |
xfrm: fix the return code when xfrm_*_register_afinfo failed
If xfrm_*_register_afinfo failed since xfrm_*_afinfo[afinfo->family] had the
value, return the -EEXIST, not -ENOBUFS
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm/xfrm_policy.c')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 847053ec7d91..c4c47f337a3a 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -2808,7 +2808,7 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) return -EAFNOSUPPORT; spin_lock(&xfrm_policy_afinfo_lock); if (unlikely(xfrm_policy_afinfo[afinfo->family] != NULL)) - err = -ENOBUFS; + err = -EEXIST; else { struct dst_ops *dst_ops = afinfo->dst_ops; if (likely(dst_ops->kmem_cachep == NULL)) |