diff options
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 11c4ca13ec3b..5c5db6636704 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -257,6 +257,9 @@ static int inet_create(struct net *net, struct socket *sock, int protocol, | |||
257 | int try_loading_module = 0; | 257 | int try_loading_module = 0; |
258 | int err; | 258 | int err; |
259 | 259 | ||
260 | if (protocol < 0 || protocol >= IPPROTO_MAX) | ||
261 | return -EINVAL; | ||
262 | |||
260 | sock->state = SS_UNCONNECTED; | 263 | sock->state = SS_UNCONNECTED; |
261 | 264 | ||
262 | /* Look for the requested type/protocol pair. */ | 265 | /* Look for the requested type/protocol pair. */ |