diff options
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 16 | ||||
-rw-r--r-- | net/xfrm/xfrm_state.c | 8 |
2 files changed, 12 insertions, 12 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index c3725fe2a8fb..b469c8b54613 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -57,12 +57,12 @@ int xfrm_register_type(struct xfrm_type *type, unsigned short family) | |||
57 | return -EAFNOSUPPORT; | 57 | return -EAFNOSUPPORT; |
58 | typemap = afinfo->type_map; | 58 | typemap = afinfo->type_map; |
59 | 59 | ||
60 | write_lock(&typemap->lock); | 60 | write_lock_bh(&typemap->lock); |
61 | if (likely(typemap->map[type->proto] == NULL)) | 61 | if (likely(typemap->map[type->proto] == NULL)) |
62 | typemap->map[type->proto] = type; | 62 | typemap->map[type->proto] = type; |
63 | else | 63 | else |
64 | err = -EEXIST; | 64 | err = -EEXIST; |
65 | write_unlock(&typemap->lock); | 65 | write_unlock_bh(&typemap->lock); |
66 | xfrm_policy_put_afinfo(afinfo); | 66 | xfrm_policy_put_afinfo(afinfo); |
67 | return err; | 67 | return err; |
68 | } | 68 | } |
@@ -78,12 +78,12 @@ int xfrm_unregister_type(struct xfrm_type *type, unsigned short family) | |||
78 | return -EAFNOSUPPORT; | 78 | return -EAFNOSUPPORT; |
79 | typemap = afinfo->type_map; | 79 | typemap = afinfo->type_map; |
80 | 80 | ||
81 | write_lock(&typemap->lock); | 81 | write_lock_bh(&typemap->lock); |
82 | if (unlikely(typemap->map[type->proto] != type)) | 82 | if (unlikely(typemap->map[type->proto] != type)) |
83 | err = -ENOENT; | 83 | err = -ENOENT; |
84 | else | 84 | else |
85 | typemap->map[type->proto] = NULL; | 85 | typemap->map[type->proto] = NULL; |
86 | write_unlock(&typemap->lock); | 86 | write_unlock_bh(&typemap->lock); |
87 | xfrm_policy_put_afinfo(afinfo); | 87 | xfrm_policy_put_afinfo(afinfo); |
88 | return err; | 88 | return err; |
89 | } | 89 | } |
@@ -1251,7 +1251,7 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) | |||
1251 | return -EINVAL; | 1251 | return -EINVAL; |
1252 | if (unlikely(afinfo->family >= NPROTO)) | 1252 | if (unlikely(afinfo->family >= NPROTO)) |
1253 | return -EAFNOSUPPORT; | 1253 | return -EAFNOSUPPORT; |
1254 | write_lock(&xfrm_policy_afinfo_lock); | 1254 | write_lock_bh(&xfrm_policy_afinfo_lock); |
1255 | if (unlikely(xfrm_policy_afinfo[afinfo->family] != NULL)) | 1255 | if (unlikely(xfrm_policy_afinfo[afinfo->family] != NULL)) |
1256 | err = -ENOBUFS; | 1256 | err = -ENOBUFS; |
1257 | else { | 1257 | else { |
@@ -1268,7 +1268,7 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) | |||
1268 | afinfo->garbage_collect = __xfrm_garbage_collect; | 1268 | afinfo->garbage_collect = __xfrm_garbage_collect; |
1269 | xfrm_policy_afinfo[afinfo->family] = afinfo; | 1269 | xfrm_policy_afinfo[afinfo->family] = afinfo; |
1270 | } | 1270 | } |
1271 | write_unlock(&xfrm_policy_afinfo_lock); | 1271 | write_unlock_bh(&xfrm_policy_afinfo_lock); |
1272 | return err; | 1272 | return err; |
1273 | } | 1273 | } |
1274 | EXPORT_SYMBOL(xfrm_policy_register_afinfo); | 1274 | EXPORT_SYMBOL(xfrm_policy_register_afinfo); |
@@ -1280,7 +1280,7 @@ int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo) | |||
1280 | return -EINVAL; | 1280 | return -EINVAL; |
1281 | if (unlikely(afinfo->family >= NPROTO)) | 1281 | if (unlikely(afinfo->family >= NPROTO)) |
1282 | return -EAFNOSUPPORT; | 1282 | return -EAFNOSUPPORT; |
1283 | write_lock(&xfrm_policy_afinfo_lock); | 1283 | write_lock_bh(&xfrm_policy_afinfo_lock); |
1284 | if (likely(xfrm_policy_afinfo[afinfo->family] != NULL)) { | 1284 | if (likely(xfrm_policy_afinfo[afinfo->family] != NULL)) { |
1285 | if (unlikely(xfrm_policy_afinfo[afinfo->family] != afinfo)) | 1285 | if (unlikely(xfrm_policy_afinfo[afinfo->family] != afinfo)) |
1286 | err = -EINVAL; | 1286 | err = -EINVAL; |
@@ -1294,7 +1294,7 @@ int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo) | |||
1294 | afinfo->garbage_collect = NULL; | 1294 | afinfo->garbage_collect = NULL; |
1295 | } | 1295 | } |
1296 | } | 1296 | } |
1297 | write_unlock(&xfrm_policy_afinfo_lock); | 1297 | write_unlock_bh(&xfrm_policy_afinfo_lock); |
1298 | return err; | 1298 | return err; |
1299 | } | 1299 | } |
1300 | EXPORT_SYMBOL(xfrm_policy_unregister_afinfo); | 1300 | EXPORT_SYMBOL(xfrm_policy_unregister_afinfo); |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 3dc3e1f3b7aa..93a2f36ad3db 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -1061,7 +1061,7 @@ int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo) | |||
1061 | return -EINVAL; | 1061 | return -EINVAL; |
1062 | if (unlikely(afinfo->family >= NPROTO)) | 1062 | if (unlikely(afinfo->family >= NPROTO)) |
1063 | return -EAFNOSUPPORT; | 1063 | return -EAFNOSUPPORT; |
1064 | write_lock(&xfrm_state_afinfo_lock); | 1064 | write_lock_bh(&xfrm_state_afinfo_lock); |
1065 | if (unlikely(xfrm_state_afinfo[afinfo->family] != NULL)) | 1065 | if (unlikely(xfrm_state_afinfo[afinfo->family] != NULL)) |
1066 | err = -ENOBUFS; | 1066 | err = -ENOBUFS; |
1067 | else { | 1067 | else { |
@@ -1069,7 +1069,7 @@ int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo) | |||
1069 | afinfo->state_byspi = xfrm_state_byspi; | 1069 | afinfo->state_byspi = xfrm_state_byspi; |
1070 | xfrm_state_afinfo[afinfo->family] = afinfo; | 1070 | xfrm_state_afinfo[afinfo->family] = afinfo; |
1071 | } | 1071 | } |
1072 | write_unlock(&xfrm_state_afinfo_lock); | 1072 | write_unlock_bh(&xfrm_state_afinfo_lock); |
1073 | return err; | 1073 | return err; |
1074 | } | 1074 | } |
1075 | EXPORT_SYMBOL(xfrm_state_register_afinfo); | 1075 | EXPORT_SYMBOL(xfrm_state_register_afinfo); |
@@ -1081,7 +1081,7 @@ int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo) | |||
1081 | return -EINVAL; | 1081 | return -EINVAL; |
1082 | if (unlikely(afinfo->family >= NPROTO)) | 1082 | if (unlikely(afinfo->family >= NPROTO)) |
1083 | return -EAFNOSUPPORT; | 1083 | return -EAFNOSUPPORT; |
1084 | write_lock(&xfrm_state_afinfo_lock); | 1084 | write_lock_bh(&xfrm_state_afinfo_lock); |
1085 | if (likely(xfrm_state_afinfo[afinfo->family] != NULL)) { | 1085 | if (likely(xfrm_state_afinfo[afinfo->family] != NULL)) { |
1086 | if (unlikely(xfrm_state_afinfo[afinfo->family] != afinfo)) | 1086 | if (unlikely(xfrm_state_afinfo[afinfo->family] != afinfo)) |
1087 | err = -EINVAL; | 1087 | err = -EINVAL; |
@@ -1091,7 +1091,7 @@ int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo) | |||
1091 | afinfo->state_bydst = NULL; | 1091 | afinfo->state_bydst = NULL; |
1092 | } | 1092 | } |
1093 | } | 1093 | } |
1094 | write_unlock(&xfrm_state_afinfo_lock); | 1094 | write_unlock_bh(&xfrm_state_afinfo_lock); |
1095 | return err; | 1095 | return err; |
1096 | } | 1096 | } |
1097 | EXPORT_SYMBOL(xfrm_state_unregister_afinfo); | 1097 | EXPORT_SYMBOL(xfrm_state_unregister_afinfo); |