diff options
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/net/socket.c b/net/socket.c index 6d261bf206fc..6756e57e1ff0 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -973,11 +973,18 @@ int sock_create_lite(int family, int type, int protocol, struct socket **res) | |||
973 | goto out; | 973 | goto out; |
974 | } | 974 | } |
975 | 975 | ||
976 | security_socket_post_create(sock, family, type, protocol, 1); | ||
977 | sock->type = type; | 976 | sock->type = type; |
977 | err = security_socket_post_create(sock, family, type, protocol, 1); | ||
978 | if (err) | ||
979 | goto out_release; | ||
980 | |||
978 | out: | 981 | out: |
979 | *res = sock; | 982 | *res = sock; |
980 | return err; | 983 | return err; |
984 | out_release: | ||
985 | sock_release(sock); | ||
986 | sock = NULL; | ||
987 | goto out; | ||
981 | } | 988 | } |
982 | 989 | ||
983 | /* No kernel lock held - perfect */ | 990 | /* No kernel lock held - perfect */ |
@@ -1214,7 +1221,9 @@ static int __sock_create(int family, int type, int protocol, struct socket **res | |||
1214 | */ | 1221 | */ |
1215 | module_put(net_families[family]->owner); | 1222 | module_put(net_families[family]->owner); |
1216 | *res = sock; | 1223 | *res = sock; |
1217 | security_socket_post_create(sock, family, type, protocol, kern); | 1224 | err = security_socket_post_create(sock, family, type, protocol, kern); |
1225 | if (err) | ||
1226 | goto out_release; | ||
1218 | 1227 | ||
1219 | out: | 1228 | out: |
1220 | net_family_read_unlock(); | 1229 | net_family_read_unlock(); |