diff options
author | Li RongQing <roy.qing.li@gmail.com> | 2015-04-23 11:06:53 +0800 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2015-04-23 11:37:52 +0200 |
commit | f31e8d4f7b44092b6b2ab3a6b1d4079836b6955a (patch) | |
tree | 6b7a2cae68eb6a86819a0ccc3e8f8a3800afb292 /net/xfrm/xfrm_state.c | |
parent | 800777026eeb33585f29608c2c6131fc66d2e218 (diff) | |
download | blackbird-op-linux-f31e8d4f7b44092b6b2ab3a6b1d4079836b6955a.tar.gz blackbird-op-linux-f31e8d4f7b44092b6b2ab3a6b1d4079836b6955a.zip |
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_state.c')
-rw-r--r-- | net/xfrm/xfrm_state.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index df9318301e98..e47e4980b35c 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -1908,7 +1908,7 @@ int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo) return -EAFNOSUPPORT; spin_lock_bh(&xfrm_state_afinfo_lock); if (unlikely(xfrm_state_afinfo[afinfo->family] != NULL)) - err = -ENOBUFS; + err = -EEXIST; else rcu_assign_pointer(xfrm_state_afinfo[afinfo->family], afinfo); spin_unlock_bh(&xfrm_state_afinfo_lock); |