Merge tag 'v3.10.95' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / irda / af_irda.c
index a5e62ef5715560d03d260191d0c6e6f3ecec2b4b..f8133ff5b081840662a728373df5c40f2e165da1 100644 (file)
@@ -1105,6 +1105,9 @@ static int irda_create(struct net *net, struct socket *sock, int protocol,
 
        IRDA_DEBUG(2, "%s()\n", __func__);
 
+       if (protocol < 0 || protocol > SK_PROTOCOL_MAX)
+               return -EINVAL;
+
        if (net != &init_net)
                return -EAFNOSUPPORT;