diff options
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/socket.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 8cefacb55aad..a1f22100a616 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -169,12 +169,6 @@ static int tipc_create(struct socket *sock, int protocol) | |||
169 | struct sock *sk; | 169 | struct sock *sk; |
170 | u32 ref; | 170 | u32 ref; |
171 | 171 | ||
172 | if ((sock->type != SOCK_STREAM) && | ||
173 | (sock->type != SOCK_SEQPACKET) && | ||
174 | (sock->type != SOCK_DGRAM) && | ||
175 | (sock->type != SOCK_RDM)) | ||
176 | return -EPROTOTYPE; | ||
177 | |||
178 | if (unlikely(protocol != 0)) | 172 | if (unlikely(protocol != 0)) |
179 | return -EPROTONOSUPPORT; | 173 | return -EPROTONOSUPPORT; |
180 | 174 | ||
@@ -199,6 +193,9 @@ static int tipc_create(struct socket *sock, int protocol) | |||
199 | sock->ops = &msg_ops; | 193 | sock->ops = &msg_ops; |
200 | sock->state = SS_READY; | 194 | sock->state = SS_READY; |
201 | break; | 195 | break; |
196 | default: | ||
197 | tipc_deleteport(ref); | ||
198 | return -EPROTOTYPE; | ||
202 | } | 199 | } |
203 | 200 | ||
204 | sk = sk_alloc(AF_TIPC, GFP_KERNEL, &tipc_proto, 1); | 201 | sk = sk_alloc(AF_TIPC, GFP_KERNEL, &tipc_proto, 1); |