summaryrefslogtreecommitdiff
path: root/net/ipv4/af_inet.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-12-23 08:33:34 +0100
committerTakashi Iwai <tiwai@suse.de>2015-12-23 08:33:34 +0100
commit59c8231089be96165735585694a801ae58ec6c95 (patch)
tree41bd60a9aec5df20e07a81fbb526c8bc05e997fc /net/ipv4/af_inet.c
parentde5126cc3c0b0f291d08fa591dcdf237bc595a56 (diff)
parent0fb0b822d157325b66c503d23332f64899bfb828 (diff)
Merge branch 'for-linus' into for-next
Conflicts: drivers/gpu/drm/i915/intel_pm.c
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r--net/ipv4/af_inet.c3
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,
int try_loading_module = 0;
int err;
+ if (protocol < 0 || protocol >= IPPROTO_MAX)
+ return -EINVAL;
+
sock->state = SS_UNCONNECTED;
/* Look for the requested type/protocol pair. */