diff options
author | Mark Brown <broonie@kernel.org> | 2016-02-10 18:20:48 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-02-10 18:20:48 +0000 |
commit | 0e770f4e70e8221454854b962adc258b6035ecdd (patch) | |
tree | db146cb0453047b334e6cc882fda74fd7cba3525 /net/ipv4/af_inet.c | |
parent | a69ce65274ff1589bb64ea782a4178d7210da0bb (diff) | |
parent | cd6f5814252060db2d38f57c602db33696c549c0 (diff) |
Merge branch 'linux-linaro-lsk-v3.10' into linux-linaro-lsk-v3.10-androidlsk-v3.10-16.02-android
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 f022e0e97dc5..14ad21e2fd31 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -304,6 +304,9 @@ static int inet_create(struct net *net, struct socket *sock, int protocol, if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM) build_ehash_secret(); + if (protocol < 0 || protocol >= IPPROTO_MAX) + return -EINVAL; + sock->state = SS_UNCONNECTED; /* Look for the requested type/protocol pair. */ |