diff options
Diffstat (limited to 'net/xfrm/xfrm_state.c')
-rw-r--r-- | net/xfrm/xfrm_state.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 93a2f36ad3db..ee62c239a7e3 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -1103,17 +1103,14 @@ static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family) | |||
1103 | return NULL; | 1103 | return NULL; |
1104 | read_lock(&xfrm_state_afinfo_lock); | 1104 | read_lock(&xfrm_state_afinfo_lock); |
1105 | afinfo = xfrm_state_afinfo[family]; | 1105 | afinfo = xfrm_state_afinfo[family]; |
1106 | if (likely(afinfo != NULL)) | 1106 | if (unlikely(!afinfo)) |
1107 | read_lock(&afinfo->lock); | 1107 | read_unlock(&xfrm_state_afinfo_lock); |
1108 | read_unlock(&xfrm_state_afinfo_lock); | ||
1109 | return afinfo; | 1108 | return afinfo; |
1110 | } | 1109 | } |
1111 | 1110 | ||
1112 | static void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo) | 1111 | static void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo) |
1113 | { | 1112 | { |
1114 | if (unlikely(afinfo == NULL)) | 1113 | read_unlock(&xfrm_state_afinfo_lock); |
1115 | return; | ||
1116 | read_unlock(&afinfo->lock); | ||
1117 | } | 1114 | } |
1118 | 1115 | ||
1119 | /* Temporarily located here until net/xfrm/xfrm_tunnel.c is created */ | 1116 | /* Temporarily located here until net/xfrm/xfrm_tunnel.c is created */ |